A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implementation of the back trace functions for Win32 on the x86 architecture
[simgrid.git]
/
src
/
xbt
/
snprintf.c
diff --git
a/src/xbt/snprintf.c
b/src/xbt/snprintf.c
index
8ce12fe
..
0dbbadb
100644
(file)
--- a/
src/xbt/snprintf.c
+++ b/
src/xbt/snprintf.c
@@
-280,7
+280,6
@@
*/
*/
-
\f
/* ============================================= */
/* NO USER SERVICABLE PARTS FOLLOWING THIS POINT */
/* ============================================= */
/* ============================================= */
/* NO USER SERVICABLE PARTS FOLLOWING THIS POINT */
/* ============================================= */
@@
-327,6
+326,7
@@
#include <assert.h>
#include <errno.h>
#include <assert.h>
#include <errno.h>
+#include "xbt/str.h"
#ifdef isdigit
#undef isdigit
#ifdef isdigit
#undef isdigit
@@
-380,12
+380,14
@@
/* prototypes */
/* prototypes */
+
#if defined(NEED_ASPRINTF)
int asprintf (char **ptr, const char *fmt, /*args*/ ...);
#endif
#if defined(NEED_ASPRINTF)
int asprintf (char **ptr, const char *fmt, /*args*/ ...);
#endif
-#if defined(NEED_VASPRINTF)
+#if defined(NEED_VASPRINTF)
int vasprintf (char **ptr, const char *fmt, va_list ap);
#endif
int vasprintf (char **ptr, const char *fmt, va_list ap);
#endif
+
#if defined(NEED_ASNPRINTF)
int asnprintf (char **ptr, size_t str_m, const char *fmt, /*args*/ ...);
#endif
#if defined(NEED_ASNPRINTF)
int asnprintf (char **ptr, size_t str_m, const char *fmt, /*args*/ ...);
#endif
@@
-396,6
+398,12
@@
int vasnprintf (char **ptr, size_t str_m, const char *fmt, va_list ap);
#if defined(HAVE_SNPRINTF)
/* declare our portable snprintf routine under name portable_snprintf */
/* declare our portable vsnprintf routine under name portable_vsnprintf */
#if defined(HAVE_SNPRINTF)
/* declare our portable snprintf routine under name portable_snprintf */
/* declare our portable vsnprintf routine under name portable_vsnprintf */
+# if defined(_MSC_VER) && (_MSC_VER >= 1400)
+# define portable_snprintf _snprintf
+# if !defined(NEED_SNPRINTF_ONLY)
+# define portable_vsnprintf vsnprintf
+# endif
+# endif
#else
/* declare our portable routines under names snprintf and vsnprintf */
#define portable_snprintf snprintf
#else
/* declare our portable routines under names snprintf and vsnprintf */
#define portable_snprintf snprintf
@@
-1043,7
+1051,10
@@
char *bprintf(const char*fmt, ...) {
char *res;
va_start(ap, fmt);
char *res;
va_start(ap, fmt);
- vasprintf(&res,fmt,ap);
+
+
+ vasprintf(&res,fmt,ap);
+
va_end(ap);
return res;
}
va_end(ap);
return res;
}