X-Git-Url: http://git.tuebingen.mpg.de/?p=adu.git;a=blobdiff_plain;f=adu.h;h=45dae6aa5ee5e973a6fad70adcf30553dc9feccd;hp=42b9471ee251e0ccf28ffd185628bfdd3d315634;hb=3d29aa18911043879fcd4412fa25b0ab5f5e95bb;hpb=ba2d3fccbd565c9f5f8f652fcc300672e7bf09be;ds=sidebyside diff --git a/adu.h b/adu.h index 42b9471..45dae6a 100644 --- a/adu.h +++ b/adu.h @@ -85,36 +85,6 @@ #endif /** \endcond */ -/** - * Write a log message to a dynamically allocated string. - * - * \param fmt Usual format string. - * \param p Result pointer. - * - * \sa printf(3). */ -#define VSPRINTF(fmt, p) \ -{ \ - int n; \ - size_t size = 100; \ - p = adu_malloc(size); \ - while (1) { \ - va_list ap; \ - /* Try to print in the allocated space. */ \ - va_start(ap, fmt); \ - n = vsnprintf(p, size, fmt, ap); \ - va_end(ap); \ - /* If that worked, return the string. */ \ - if (n > -1 && n < size) \ - break; \ - /* Else try again with more space. */ \ - if (n > -1) /* glibc 2.1 */ \ - size = n + 1; /* precisely what is needed */ \ - else /* glibc 2.0 */ \ - size *= 2; /* twice the old size */ \ - p = adu_realloc(p, size); \ - } \ -} - /** Evaluates to 1 if x < y, to -1 if x > y and to 0 if x == y. */ #define NUM_COMPARE(x, y) ((int)((x) < (y)) - (int)((x) > (y)))