From 69d8435cd1cf98623a903b35a3d4673788547475 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 22 Jan 2001 11:20:39 -0500 Subject: [svn-r3317] Purpose: Bug Fix Description: Fix definition of strdup on Windows machines. Solution: Merged duplicate definitions into one cohesive block of definitions. Platforms tested: FreeBSD 4.2 (hawkwind) --- src/H5private.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/H5private.h b/src/H5private.h index c19bd59..da63965 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -727,24 +727,21 @@ __DLL__ int64_t HDstrtoll (const char *s, const char **rest, int base); * And now for a couple non-Posix functions... Watch out for systems that * define these in terms of macros. */ +#ifdef WIN32 +#define HDstrdup(S) _strdup(S) +#else + #ifdef LATER -#if !defined strdup && !defined HAVE_STRDUP && !defined _strdup +#if !defined strdup && !defined HAVE_STRDUP extern char *strdup(const char *s); #endif #else /* LATER */ extern char *strdup(const char *s); #endif /* LATER */ -#define HDstrdup(S) strdup(S) - -#ifdef WIN32 -#define HDstrdup(S) _strdup(S) -#elif !defined strdup && !defined HAVE_STRDUP -char *strdup(const char *s); -#define HDstrdup(S) strdup(S) -#else #define HDstrdup(S) strdup(S) -#endif + +#endif /* WIN32 */ #ifndef H5_HAVE_SNPRINTF -- cgit v0.12