From: cherierm Date: Tue, 13 Mar 2007 13:19:43 +0000 (+0000) Subject: visual c++ need snprintf and vsnprintf functions X-Git-Tag: v3.3~2103 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5c5685dc7dbf80037da524d5787a8265bf36a552 visual c++ need snprintf and vsnprintf functions git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3256 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/portable.h b/src/portable.h index ab84d51c99..61a3ea0f43 100644 --- a/src/portable.h +++ b/src/portable.h @@ -121,10 +121,19 @@ #ifdef HAVE_SNPRINTF #include #else +# if (defined(_MSC_VER) && defined(DLL_EXPORT)) + __declspec(dllexport) int snprintf(char *, size_t, const char *, /*args*/ ...); + __declspec(dllexport) int vsnprintf(char *, size_t, const char *, va_list); +# elif (defined(_MSC_VER) && !defined(DLL_EXPORT) && !defined(DLL_STATIC) ) + __declspec(dllimport) int snprintf(char *, size_t, const char *, /*args*/ ...); + __declspec(dllimport) int vsnprintf(char *, size_t, const char *, va_list); +#else extern int snprintf(char *, size_t, const char *, /*args*/ ...); extern int vsnprintf(char *, size_t, const char *, va_list); #endif +#endif + /* use internal functions when OS provided ones are borken */ #if defined(HAVE_SNPRINTF) && defined(PREFER_PORTABLE_SNPRINTF) extern int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args*/ ...);