From a59340736c6aef0d67fe88a16e0cd1fa8e18ae9a Mon Sep 17 00:00:00 2001 From: cherierm Date: Fri, 16 Mar 2007 13:23:31 +0000 Subject: [PATCH] ssize_t is not defined in borland builder and visual C++ and now asprintf and 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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/xbt/sysdep.h b/include/xbt/sysdep.h index ab6684b469..41708e07c6 100644 --- a/include/xbt/sysdep.h +++ b/include/xbt/sysdep.h @@ -22,10 +22,16 @@ 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); + +#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); -- 2.20.1