diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-05-05 06:57:26 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-05-05 06:57:26 +0000 |
commit | 4d9517f0b4092b62dc791125823d6ce581d0c26c (patch) | |
tree | 1ac07ac51c559cd6c9a77e7b365dc8a800a2c429 /lib/mprintf.c | |
parent | a331aa02213238d8efae9a046fea93860c62fc87 (diff) |
prevent warnings when using the gcc option -Wunreachable-code
Diffstat (limited to 'lib/mprintf.c')
-rw-r--r-- | lib/mprintf.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/mprintf.c b/lib/mprintf.c index ddf34edf8..e8613839f 100644 --- a/lib/mprintf.c +++ b/lib/mprintf.c @@ -44,6 +44,11 @@ #define SIZEOF_LONG_DOUBLE 0 #endif +#ifndef SIZEOF_SIZE_T +/* default to 4 bytes for size_t unless defined in the config.h */ +#define SIZEOF_SIZE_T 4 +#endif + #ifdef DPRINTF_DEBUG #define HAVE_LONGLONG #define LONG_LONG long long @@ -381,11 +386,12 @@ static long dprintf_Pass1(char *format, va_stack_t *vto, char **endpos, case 'z': /* the code below generates a warning if -Wunreachable-code is used */ - if (sizeof(size_t) > sizeof(unsigned long)) - flags |= FLAGS_LONGLONG; - if (sizeof(size_t) > sizeof(unsigned int)) - flags |= FLAGS_LONG; - break; +#if SIZEOF_SIZE_T>4 + flags |= FLAGS_LONGLONG; +#else + flags |= FLAGS_LONG; +#endif + break; case 'O': #if SIZEOF_CURL_OFF_T > 4 flags |= FLAGS_LONGLONG; |