Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ssize_t is not defined in borland builder and visual C++ and now asprintf and
authorcherierm <cherierm@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 16 Mar 2007 13:23:31 +0000 (13:23 +0000)
committercherierm <cherierm@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 16 Mar 2007 13:23:31 +0000 (13:23 +0000)
vasprintf are not exported in the windows dll

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3293 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/xbt/sysdep.h

index ab6684b..41708e0 100644 (file)
 SG_BEGIN_DECL()
 
 /* FIXME: better place? */
 SG_BEGIN_DECL()
 
 /* FIXME: better place? */
-XBT_PUBLIC(int)   asprintf  (char **ptr, const char *fmt, /*args*/ ...) _XBT_GNUC_PRINTF(2,3);
-XBT_PUBLIC(int)   vasprintf (char **ptr, const char *fmt, va_list ap);
+extern int   asprintf  (char **ptr, const char *fmt, /*args*/ ...) _XBT_GNUC_PRINTF(2,3);
+extern int vasprintf (char **ptr, const char *fmt, va_list ap);
 XBT_PUBLIC(char*) bprintf   (const char*fmt, ...) _XBT_GNUC_PRINTF(1,2);
 
 XBT_PUBLIC(char*) bprintf   (const char*fmt, ...) _XBT_GNUC_PRINTF(1,2);
 
+
+#if ((defined (_MSC_VER) || defined(__BORLANDC__)) && !defined(SSIZE_T_DEFINED))
+typedef int ssize_t;
+#define SSIZE_T_DEFINED
+#endif
+
 /* FIXME: ssize_t must be 'long' on windows, no idea whether we should define this explicitly */
 XBT_PUBLIC(ssize_t) getline(char **lineptr, size_t *n, FILE *stream);
 
 /* FIXME: ssize_t must be 'long' on windows, no idea whether we should define this explicitly */
 XBT_PUBLIC(ssize_t) getline(char **lineptr, size_t *n, FILE *stream);