diff --git a/source/lib/config.h b/source/lib/config.h index 166297ab42..398c7f51df 100644 --- a/source/lib/config.h +++ b/source/lib/config.h @@ -313,9 +313,11 @@ // strdup, wcsdup #if OS_MACOSX -# define HAVE_STRDUP 0 +# define HAVE_STRDUP 1 +# define HAVE_WCSDUP 0 #else # define HAVE_STRDUP 1 +# define HAVE_WCSDUP 1 #endif // emulation needed on VC8 because this function is "deprecated" diff --git a/source/lib/posix/posix.cpp b/source/lib/posix/posix.cpp index 79465e82a5..ba7a1355d6 100644 --- a/source/lib/posix/posix.cpp +++ b/source/lib/posix/posix.cpp @@ -74,7 +74,6 @@ uint fpclassifyf(float f) #if !HAVE_STRDUP - char* strdup(const char* str) { const size_t num_chars = strlen(str); @@ -84,7 +83,9 @@ char* strdup(const char* str) SAFE_STRCPY(dst, str); return dst; } +#endif +#if !HAVE_WCSDUP wchar_t* wcsdup(const wchar_t* str) { const size_t num_chars = wcslen(str); @@ -94,5 +95,4 @@ wchar_t* wcsdup(const wchar_t* str) SAFE_WCSCPY(dst, str); return dst; } - -#endif // #if !HAVE_STRDUP +#endif // #if !HAVE_WCSDUP diff --git a/source/lib/posix/posix.h b/source/lib/posix/posix.h index 882dea859d..76141c46de 100644 --- a/source/lib/posix/posix.h +++ b/source/lib/posix/posix.h @@ -84,8 +84,10 @@ need only be renamed (e.g. _open, _stat). #if !HAVE_STRDUP extern char* strdup(const char* str); +#endif +#if !HAVE_WCSDUP extern wchar_t* wcsdup(const wchar_t* str); -#endif // #if !HAVE_STRDUP +#endif #if !HAVE_C99_MATH