Windows: rk_strdup allocator

patchset 3fe5572840 should have
replaced strdup().

Change-Id: I7af7b3e953e379fb23fccd9fa7a9e02c354c2dc4
This commit is contained in:
Jeffrey Altman
2012-07-20 00:50:47 -04:00
parent 13a6ac59ad
commit 0686ad5ece
2 changed files with 21 additions and 10 deletions

View File

@@ -358,6 +358,7 @@ rk_vsnprintf (char *str, size_t sz, const char *format, va_list args);
#define free rk_free
#define malloc rk_malloc
#define realloc rk_realloc
#define strdup rk_strdup
#endif
ROKEN_LIB_FUNCTION void * ROKEN_LIB_CALL
@@ -372,6 +373,9 @@ rk_malloc(size_t);
ROKEN_LIB_FUNCTION void * ROKEN_LIB_CALL
rk_realloc(void *, size_t);
ROKEN_LIB_FUNCTION char * ROKEN_LIB_CALL
rk_strdup(const char *);
#endif /* _MSC_VER */
#ifdef HAVE_WINSOCK

View File

@@ -33,6 +33,7 @@
#undef calloc
#undef malloc
#undef free
#undef strdup
/*
* Windows executables and dlls suffer when memory is
@@ -60,3 +61,9 @@ rk_malloc(size_t size)
{
return malloc( size);
}
ROKEN_LIB_FUNCTION char * ROKEN_LIB_CALL
rk_strdup(const char *str)
{
return strdup( str);
}