diff options
Diffstat (limited to 'deps/regex/regex_internal.h')
-rw-r--r-- | deps/regex/regex_internal.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/deps/regex/regex_internal.h b/deps/regex/regex_internal.h index 4184d7f5a..53ccebecd 100644 --- a/deps/regex/regex_internal.h +++ b/deps/regex/regex_internal.h @@ -27,6 +27,14 @@ #include <stdlib.h> #include <string.h> +#ifndef UNUSED +# ifdef __GNUC__ +# define UNUSED __attribute__((unused)) +# else +# define UNUSED +# endif +#endif + #if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC # include <langinfo.h> #endif @@ -63,7 +71,7 @@ #endif #else /* GAWK */ /* - * This is a freaking mess. On glibc systems you have to define + * This is a mess. On glibc systems you have to define * a magic constant to get isblank() out of <ctype.h>, since it's * a C99 function. To heck with all that and borrow a page from * dfa.c's book. @@ -171,8 +179,9 @@ extern const size_t __re_error_msgid_idx[] attribute_hidden; typedef unsigned long int bitset_word_t; /* All bits set in a bitset_word_t. */ #define BITSET_WORD_MAX ULONG_MAX -/* Number of bits in a bitset_word_t. */ -#define BITSET_WORD_BITS (sizeof (bitset_word_t) * CHAR_BIT) +/* Number of bits in a bitset_word_t. Cast to int as most code use it + * like that for counting */ +#define BITSET_WORD_BITS ((int)(sizeof (bitset_word_t) * CHAR_BIT)) /* Number of bitset_word_t in a bit_set. */ #define BITSET_WORDS (SBC_MAX / BITSET_WORD_BITS) typedef bitset_word_t bitset_t[BITSET_WORDS]; |