Skip to content

Commit 366bcd5

Browse files
author
Pascal Beyer
committed
Add guards against a global /Dstrdup=_strdup for our oldnames hack.
1 parent 50ad8d8 commit 366bcd5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

implicit/include/runtime.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,23 @@ wchar_t *wcsrchr(wchar_t *haystack, wchar_t needle){
241241
// The sad side of it is that for now here is an ugly hack.
242242
//
243243

244+
#ifdef strdup
245+
#undef strdup
246+
#endif
244247
__declspec(dllimport) char *_strdup(char *str);
245248
char *strdup(char *str){ return _strdup(str); }
246249

250+
#ifdef getcwd
251+
#undef getcwd
252+
#endif
247253
__declspec(dllimport) char *_getcwd(char *buffer, int maxlen);
248254
char *getcwd(char *buffer, int maxlen){
249255
return getcwd(buffer, maxlen);
250256
}
251257

258+
#ifdef rmdir
259+
#undef rmdir
260+
#endif
252261
__declspec(dllimport) int _rmdir(const char *dirname);
253262
int rmdir(const char *dirname){
254263
return _rmdir(dirname);

0 commit comments

Comments
 (0)