summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler.h26
-rw-r--r--configure.in9
2 files changed, 30 insertions, 5 deletions
diff --git a/compiler.h b/compiler.h
index 26fb1cc..6e9e37e 100644
--- a/compiler.h
+++ b/compiler.h
@@ -24,11 +24,6 @@
# include "config.h"
#endif
-/* __STRICT_ANSI__ buggers up MinGW, so disable it */
-#ifdef __MINGW32__
-# undef __STRICT_ANSI__
-#endif
-
/* This is required to get the standard <inttypes.h> macros when compiling
with a C++ compiler. This must be defined *before* <inttypes.h> is
included, directly or indirectly. */
@@ -80,4 +75,25 @@ typedef enum { false, true } bool;
# endif
#endif
+/* Some misguided platforms hide the defs for these */
+#if defined(HAVE_STRCASECMP) && !HAVE_DECL_STRCASECMP
+int strcasecmp(const char *, const char *);
+#endif
+
+#if defined(HAVE_STRICMP) && !HAVE_DECL_STRICMP
+int stricmp(const char *, const char *);
+#endif
+
+#if defined(HAVE_STRNCASECMP) && !HAVE_DECL_STRNCASECMP
+int strncasecmp(const char *, const char *, size_t);
+#endif
+
+#if defined(HAVE_STRNICMP) && !HAVE_DECL_STRNICMP
+int strnicmp(const char *, const char *, size_t);
+#endif
+
+#if defined(HAVE_STRSEP) && !HAVE_DECL_STRSEP
+char *strsep(char **, const char *);
+#endif
+
#endif /* NASM_COMPILER_H */
diff --git a/configure.in b/configure.in
index 93759fd..da26da9 100644
--- a/configure.in
+++ b/configure.in
@@ -124,6 +124,15 @@ AC_CHECK_FUNCS(strsep)
AC_CHECK_FUNCS(getuid)
AC_CHECK_FUNCS(getgid)
+dnl Check for functions that might not be declared in the headers for
+dnl various idiotic reasons (mostly because of library authors
+dnl abusing the meaning of __STRICT_ANSI__)
+AC_CHECK_DECLS(strcasecmp)
+AC_CHECK_DECLS(stricmp)
+AC_CHECK_DECLS(strncasecmp)
+AC_CHECK_DECLS(strnicmp)
+AC_CHECK_DECLS(strsep)
+
if test $ac_cv_prog_make_vpathok = no; then
echo Copying generated srcs into build directory to compensate for VPATH breakage
for file in macros.c insnsa.c insnsd.c insnsn.c insnsi.h version.h version.mac; do