diff --git a/configure.ac b/configure.ac index 05e83b78..b367be91 100644 --- a/configure.ac +++ b/configure.ac @@ -77,6 +77,7 @@ AC_CHECK_LIB(m, log) AC_CHECK_HEADERS([linux/kd.h dev/isa/spkrio.h dev/speaker/speaker.h]) AC_CHECK_FUNCS(mmap ioperm) +AC_CHECK_DECLS([strcasecmp, strncasecmp], [], [], [[#include ]]) # OpenBSD I/O i386 library for I/O port access. # (64 bit has the same thing with a different name!) diff --git a/src/doomtype.h b/src/doomtype.h index e0152179..b659fe69 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -21,6 +21,8 @@ #ifndef __DOOMTYPE__ #define __DOOMTYPE__ +#include "config.h" + #if defined(_MSC_VER) && !defined(__cplusplus) #define inline __inline #endif @@ -29,11 +31,15 @@ // Outside Windows, we use strings.h for str[n]casecmp. -#ifdef _WIN32 +#if !HAVE_DECL_STRCASECMP || !HAVE_DECL_STRNCASECMP #include +#if !HAVE_DECL_STRCASECMP #define strcasecmp stricmp +#endif +#if !HAVE_DECL_STRNCASECMP #define strncasecmp strnicmp +#endif #else