mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-24 02:07:00 +00:00
macosx compat: separate strdup and wcsdup
This was SVN commit r5080.
This commit is contained in:
+3
-1
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user