X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8b95c7c1babe96565862cb1b44c392412f9dba9b..5ce1cdec3a6f447bb36c3080e7ab38a5be033351:/src/xbt/snprintf.c?ds=sidebyside diff --git a/src/xbt/snprintf.c b/src/xbt/snprintf.c index 148a59301a..c6e841f00d 100644 --- a/src/xbt/snprintf.c +++ b/src/xbt/snprintf.c @@ -49,11 +49,18 @@ * http://www.ijs.si/software/snprintf/ */ +/* find vasprintf in stdio.h */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE +#endif +#include + #include "xbt/sysdep.h" /* xbt_abort() */ #include "src/internal_config.h" /* Do we need vasprintf? */ -#include -#if !defined(HAVE_VASPRINTF) +#include + +#if !HAVE_VASPRINTF #include /* vsnprintf */ int vasprintf(char **ptr, const char *fmt, va_list ap); int vasprintf(char **ptr, const char *fmt, va_list ap) @@ -84,7 +91,7 @@ char *bvprintf(const char *fmt, va_list ap) if (vasprintf(&res, fmt, ap) < 0) { /* Do not want to use xbt_die() here, as it uses the logging - * infrastucture and may fail to allocate memory too. */ + * infrastructure and may fail to allocate memory too. */ fprintf(stderr, "bprintf: vasprintf failed. Aborting.\n"); xbt_abort(); }