Skip to content

Commit b495486

Browse files
committed
fix(windows): add posix conformant names and suppress warnings
Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>
1 parent 7f07ffd commit b495486

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

apache2/modsecurity.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,15 @@ typedef struct msc_parm msc_parm;
126126

127127
#ifdef WIN32
128128
#include <direct.h>
129+
/* Use ISO C++ conformant names for POSIX functions on Windows */
130+
#ifdef _MSC_VER
131+
#define strcasecmp _stricmp
132+
#define strncasecmp _strnicmp
133+
#define chdir _chdir
134+
/* Disable warnings about "unsafe" CRT functions (getenv, strcpy, etc.) */
135+
/* These functions are safe in ModSecurity's usage and required for portability */
136+
#pragma warning(disable: 4996)
137+
#endif
129138
#else
130139
#include <sys/types.h>
131140
#include <unistd.h>

0 commit comments

Comments
 (0)