Skip to content

Commit 906eae5

Browse files
committed
fix: avoid redefinition if already in apr
Signed-off-by: Felipe Zipitria <felipe.zipitria@owasp.org>
1 parent b495486 commit 906eae5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

apache2/modsecurity.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,16 @@ typedef struct msc_parm msc_parm;
128128
#include <direct.h>
129129
/* Use ISO C++ conformant names for POSIX functions on Windows */
130130
#ifdef _MSC_VER
131+
/* Only define if not already defined by APR or other headers */
132+
#ifndef strcasecmp
131133
#define strcasecmp _stricmp
134+
#endif
135+
#ifndef strncasecmp
132136
#define strncasecmp _strnicmp
137+
#endif
138+
#ifndef chdir
133139
#define chdir _chdir
140+
#endif
134141
/* Disable warnings about "unsafe" CRT functions (getenv, strcpy, etc.) */
135142
/* These functions are safe in ModSecurity's usage and required for portability */
136143
#pragma warning(disable: 4996)

0 commit comments

Comments
 (0)