macosx compat: separate strdup and wcsdup

This was SVN commit r5080.
This commit is contained in:
janwas 2007-05-16 23:56:08 +00:00
parent e64166360e
commit b01acce45f
3 changed files with 9 additions and 5 deletions

View file

@ -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"

View file

@ -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

View file

@ -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