diff options
author | Paul Smith <psmith@gnu.org> | 2007-05-09 02:01:53 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2007-05-09 02:01:53 +0000 |
commit | 52ebc531ce68b369594267a716e93f53720c8f1b (patch) | |
tree | 3404b1e3f513b67dd501f252d2aea327c06ca03b /make.h | |
parent | 891409f2126f8abfd64f28fe82f546d716c671e2 (diff) | |
download | gunmake-52ebc531ce68b369594267a716e93f53720c8f1b.tar.gz |
Fix Savannah bug #19656: rationalize our use of case-insensitive string
comparison functions to always use POSIX strcasecmp(). For non-POSIX
systems that use other functions (strcmpi or stricmp) use a macro to alias
strcasecmp to those. If we can't find any of them (VMS, plus whatever
UNIX doesn't have them) then define our own version in misc.c.
Diffstat (limited to 'make.h')
-rw-r--r-- | make.h | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -272,11 +272,10 @@ char *strsignal (int signum); ((a) == (b) || \ (*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1)))) # ifdef HAVE_CASE_INSENSITIVE_FS -/* This is only used on Windows/DOS platforms, so we assume strcmpi(). */ # define strieq(a, b) \ ((a) == (b) \ || (tolower((unsigned char)*(a)) == tolower((unsigned char)*(b)) \ - && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1)))) + && (*(a) == '\0' || !strcasecmp ((a) + 1, (b) + 1)))) # else # define strieq(a, b) streq(a, b) # endif @@ -286,9 +285,6 @@ char *strsignal (int signum); # define strieq(a, b) (strcmp ((a), (b)) == 0) #endif #define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0) -#ifdef VMS -int strcmpi (const char *,const char *); -#endif #if defined(__GNUC__) || defined(ENUM_BITFIELDS) # define ENUM_BITFIELD(bits) :bits @@ -474,6 +470,17 @@ char *getwd (); # define getcwd(buf, len) getwd (buf) #endif +#if !HAVE_STRCASECMP +# if HAVE_STRICMP +# define strcasecmp stricmp +# elif HAVE_STRCMPI +# define strcasecmp strcmpi +# else +/* Create our own, in misc.c */ +int strcasecmp (const char *s1, const char *s2); +# endif +#endif + extern const struct floc *reading_file; extern const struct floc **expanding_var; @@ -542,12 +549,7 @@ extern int handling_fatal_signal; # endif #endif - #ifdef __EMX__ -# if !HAVE_STRCASECMP -# define strcasecmp stricmp -# endif - # if !defined chdir # define chdir _chdir2 # endif |