diff options
author | Paul Smith <psmith@gnu.org> | 1999-10-15 07:00:58 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 1999-10-15 07:00:58 +0000 |
commit | 3e26bde6dbc9a8a46d5a1a694e6810e689cbd25a (patch) | |
tree | 20d000099ba9c0723a3c4d8925adba97aee4f2dc /make.h | |
parent | c71200d0229f75fe99d508dd3aea013ceba4d32e (diff) | |
download | gunmake-3e26bde6dbc9a8a46d5a1a694e6810e689cbd25a.tar.gz |
* Fix PR/1394.
* Apply changes from Paul Eggert.
* Many other cleanups (index/rindex --> strchr/strrchr, etc.)
Diffstat (limited to 'make.h')
-rw-r--r-- | make.h | 37 |
1 files changed, 18 insertions, 19 deletions
@@ -240,24 +240,8 @@ extern void exit PARAMS ((int)) __attribute__ ((noreturn)); #endif /* Standard headers. */ -#if ST_MTIM_NSEC -# if HAVE_INTTYPES_H -# include <inttypes.h> -# endif -# define FILE_TIMESTAMP uintmax_t -#else -# define FILE_TIMESTAMP time_t -#endif - #ifdef ANSI_STRING -# ifndef index -# define index(s, c) strchr((s), (c)) -# endif -# ifndef rindex -# define rindex(s, c) strrchr((s), (c)) -# endif - # ifndef bcmp # define bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) # endif @@ -270,6 +254,11 @@ extern void exit PARAMS ((int)) __attribute__ ((noreturn)); #else /* Not ANSI_STRING. */ +# ifndef HAVE_STRCHR +# define strchr(s, c) index((s), (c)) +# define strrchr(s, c) rindex((s), (c)) +# endif + # ifndef bcmp extern int bcmp PARAMS ((const char *, const char *, int)); # endif @@ -303,6 +292,15 @@ extern char *alloca (); # endif /* HAVE_ALLOCA_H. */ #endif /* GCC. */ +#if ST_MTIM_NSEC +# if HAVE_INTTYPES_H +# include <inttypes.h> +# endif +# define FILE_TIMESTAMP uintmax_t +#else +# define FILE_TIMESTAMP time_t +#endif + /* ISDIGIT offers the following features: - Its arg may be any int or unsigned int; it need not be an unsigned char. - It's guaranteed to evaluate its argument exactly once. @@ -321,8 +319,9 @@ extern char *alloca (); # ifdef HAVE_CASE_INSENSITIVE_FS /* This is only used on Windows/DOS platforms, so we assume strcmpi(). */ # define strieq(a, b) \ - ((a) == (b) || \ - (tolower(*(a)) == tolower(*(b)) && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1)))) + ((a) == (b) \ + || (tolower((unsigned char)*(a)) == tolower((unsigned char)*(b)) \ + && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1)))) # else # define strieq(a, b) streq(a, b) # endif @@ -338,7 +337,7 @@ extern char *alloca (); ((var += (c)), (var = ((var) << 7) + ((var) >> 20))) #ifdef HAVE_CASE_INSENSITIVE_FS /* Fold filenames */ # define HASHI(var, c) \ - ((var += tolower((c))), (var = ((var) << 7) + ((var) >> 20))) + ((var += tolower((unsigned char)(c))), (var = ((var) << 7) + ((var) >> 20))) #else # define HASHI(var, c) HASH(var,c) #endif |