summaryrefslogtreecommitdiff
path: root/compiler.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-26 18:49:29 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-10-26 18:49:29 -0700
commitc13d31a907a5d8406b9f07bb782db76e56634c2d (patch)
treef8ed7838812165fd2636ef172fa6e48258cba732 /compiler.h
parent31600d6988ce92cf29af3de905556868d9c5d2d3 (diff)
downloadnasm-c13d31a907a5d8406b9f07bb782db76e56634c2d.tar.gz
Better handling of platforms which hide "extended" functionality
Some platforms apparently feel -std=c99, which defines __STRICT_ANSI__, should also hide a bunch of function prototypes. This rather sucks. At least try to deal with it. MinGW and DJGPP both have this problem, in particular.
Diffstat (limited to 'compiler.h')
-rw-r--r--compiler.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/compiler.h b/compiler.h
index 26fb1ccd..6e9e37ef 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 */