shithub: choc

Download patch

ref: 7644356e6ea1b8e38b1ae8cdd90481f05f347513
parent: 17aa4ae92a3f5c8868c251eb14a1cb60800c0da6
author: Simon Howard <[email protected]>
date: Thu Oct 18 19:38:53 EDT 2007

Fix for strcasecmp in MSVC; #define to stricmp. Outside MSVC, use
strings.h.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 975

--- 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"
--- 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