diff --git a/include/win32/win32_compat.h b/include/win32/win32_compat.h index d57d35c..bf3295e 100755 --- a/include/win32/win32_compat.h +++ b/include/win32/win32_compat.h @@ -33,6 +33,7 @@ THE SOFTWARE. #include #include #include +#include // For size_t type typedef unsigned long fsblkcnt_t; typedef unsigned long fsfilcnt_t; @@ -151,4 +152,8 @@ int win32_gettimeofday(struct timeval *tv, struct timezone *tz); #define DllExport +#ifdef __MINGW32__ +char* strndup(const char *s, size_t n); +#endif + #endif//win32_COMPAT_H_ diff --git a/win32/win32_compat.c b/win32/win32_compat.c index d1066e3..86171e9 100644 --- a/win32/win32_compat.c +++ b/win32/win32_compat.c @@ -197,6 +197,23 @@ int win32_gettimeofday(struct timeval *tv, struct timezone *tz) return 0; } +#endif + +#ifdef __MINGW32__ +char* strndup(const char* s, size_t n) +{ + size_t len; + for(len=0; len