From b8a53329fc8bf2fe8c4f4058512f828d7654e3f8 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 20 Jul 2012 09:40:22 -0400 Subject: [PATCH] Windows: rk_wcsdup allocator patchset 3fe55728404c602884f16126e9cc60fc5a3d8f20 should have replaced wcsdup(). Change-Id: Ib1e09477b430525267c6c930d7c4ab29858a68bb --- lib/roken/roken.h.in | 4 ++++ lib/roken/win32_alloc.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index eeb1e083a..bf05de3d5 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -359,6 +359,7 @@ rk_vsnprintf (char *str, size_t sz, const char *format, va_list args); #define malloc rk_malloc #define realloc rk_realloc #define strdup rk_strdup +#define wcsdup rk_wcsdup #endif ROKEN_LIB_FUNCTION void * ROKEN_LIB_CALL @@ -376,6 +377,9 @@ rk_realloc(void *, size_t); ROKEN_LIB_FUNCTION char * ROKEN_LIB_CALL rk_strdup(const char *); +ROKEN_LIB_FUNCTION unsigned short * ROKEN_LIB_CALL +rk_wcsdup(const unsigned short *); + #endif /* _MSC_VER */ #ifdef HAVE_WINSOCK diff --git a/lib/roken/win32_alloc.c b/lib/roken/win32_alloc.c index e08312305..40fe0f4fe 100644 --- a/lib/roken/win32_alloc.c +++ b/lib/roken/win32_alloc.c @@ -34,6 +34,7 @@ #undef malloc #undef free #undef strdup +#undef wcsdup /* * Windows executables and dlls suffer when memory is @@ -67,3 +68,9 @@ rk_strdup(const char *str) { return strdup( str); } + +ROKEN_LIB_FUNCTION unsigned short * ROKEN_LIB_CALL +rk_wcsdup(const unsigned short *str) +{ + return wcsdup( str); +}