diff dwcompat.h @ 1601:71e0a3ad07f7

Enable level 3 warnings in DEBUG mode with Visual C to show deprecation warnings. Source code cleanup to eliminate the warnings now generated on this level.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 26 Feb 2012 09:21:35 +0000
parents 6baf177f335c
children de4b88ee7ad8
line wrap: on
line diff
--- a/dwcompat.h	Sat Feb 25 23:35:59 2012 +0000
+++ b/dwcompat.h	Sun Feb 26 09:21:35 2012 +0000
@@ -198,9 +198,23 @@
 #define P_NOWAIT _P_NOWAIT
 #endif
 
-#define strcasecmp stricmp
-#define strncasecmp strnicmp
-#define msleep Sleep
+#ifdef _MSC_VER
+/* Handle deprecated functions in Visual C */
+#  if _MSC_VER >= 1400
+#  define strcasecmp(a, b) _stricmp(a, b)
+#  define strncasecmp(a, b, c) _strnicmp(a, b, c)
+#  define strdup(a) _strdup(a)
+#  define unlink(a) _unlink(a)
+#  define close(a) _close(a)
+#  define mkdir(a) _mkdir(a)
+#  define fdopen(a, b) _fdopen(a, b)
+#  define chdir(a) _chdir(a)
+#  else
+#  define strcasecmp(a, b) stricmp(a, b)
+#  define strncasecmp(a, b, c) strnicmp(a, b, c)
+#  endif
+#endif
+#define msleep(a) Sleep(a)
 
 #endif /* WIN32 */