X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e993852fadf35937e44a7b37eaecad48588b5a2e..df740d05eb82dc5c7af785e0967db186f9ea194c:/src/xbt/snprintf.c diff --git a/src/xbt/snprintf.c b/src/xbt/snprintf.c index 5053d29e87..2bd4b7e16a 100644 --- a/src/xbt/snprintf.c +++ b/src/xbt/snprintf.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2005-2010, 2012-2016. The SimGrid Team. +/* Copyright (c) 2005-2019. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -49,10 +49,18 @@ * http://www.ijs.si/software/snprintf/ */ -#include "xbt/sysdep.h" /* xbt_abort() */ -#include "simgrid_config.h" /* Do we need vasprintf? */ +/* 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) +#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) @@ -83,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(); }