summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2007-10-18 23:38:53 +0000
committerSimon Howard2007-10-18 23:38:53 +0000
commit7644356e6ea1b8e38b1ae8cdd90481f05f347513 (patch)
treeacd6ba928e13f1088365abc15e6c3d99f7e236f3
parent17aa4ae92a3f5c8868c251eb14a1cb60800c0da6 (diff)
downloadchocolate-doom-7644356e6ea1b8e38b1ae8cdd90481f05f347513.tar.gz
chocolate-doom-7644356e6ea1b8e38b1ae8cdd90481f05f347513.tar.bz2
chocolate-doom-7644356e6ea1b8e38b1ae8cdd90481f05f347513.zip
Fix for strcasecmp in MSVC; #define to stricmp. Outside MSVC, use
strings.h. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 975
-rw-r--r--src/deh_main.c1
-rw-r--r--src/doomdef.h15
2 files changed, 15 insertions, 1 deletions
diff --git a/src/deh_main.c b/src/deh_main.c
index 7d86e4b2..b69c049d 100644
--- a/src/deh_main.c
+++ b/src/deh_main.c
@@ -25,7 +25,6 @@
//-----------------------------------------------------------------------------
#include <ctype.h>
-#include <strings.h>
#include "doomdef.h"
#include "doomtype.h"
diff --git a/src/doomdef.h b/src/doomdef.h
index bcd27e27..08d06422 100644
--- a/src/doomdef.h
+++ b/src/doomdef.h
@@ -31,6 +31,21 @@
#include <stdio.h>
#include <string.h>
+// Portable header to provide the strcasecmp/strncasecmp functions.
+// On Windows, stricmp/strnicmp is used as a replacement.
+
+#ifdef _WIN32
+
+#define strcasecmp stricmp
+#define strncasecmp strnicmp
+
+#else
+
+#include <strings.h>
+
+#endif
+
+
//
// The packed attribute forces structures to be packed into the minimum
// space necessary. If this is not done, the compiler may align structure