summaryrefslogtreecommitdiff
path: root/ares_nowarn.c
diff options
context:
space:
mode:
Diffstat (limited to 'ares_nowarn.c')
-rw-r--r--ares_nowarn.c46
1 files changed, 13 insertions, 33 deletions
diff --git a/ares_nowarn.c b/ares_nowarn.c
index d4bd272..7f9035c 100644
--- a/ares_nowarn.c
+++ b/ares_nowarn.c
@@ -40,42 +40,22 @@
#include "ares_nowarn.h"
-#if (SIZEOF_SHORT == 2)
+#ifndef HAVE_LIMITS_H
+/* systems without <limits.h> we guess have 16 bit shorts, 32bit ints and
+ 32bit longs */
# define CARES_MASK_SSHORT 0x7FFF
# define CARES_MASK_USHORT 0xFFFF
-#elif (SIZEOF_SHORT == 4)
-# define CARES_MASK_SSHORT 0x7FFFFFFF
-# define CARES_MASK_USHORT 0xFFFFFFFF
-#elif (SIZEOF_SHORT == 8)
-# define CARES_MASK_SSHORT 0x7FFFFFFFFFFFFFFF
-# define CARES_MASK_USHORT 0xFFFFFFFFFFFFFFFF
-#else
-# error "SIZEOF_SHORT not defined"
-#endif
-
-#if (SIZEOF_INT == 2)
-# define CARES_MASK_SINT 0x7FFF
-# define CARES_MASK_UINT 0xFFFF
-#elif (SIZEOF_INT == 4)
-# define CARES_MASK_SINT 0x7FFFFFFF
-# define CARES_MASK_UINT 0xFFFFFFFF
-#elif (SIZEOF_INT == 8)
-# define CARES_MASK_SINT 0x7FFFFFFFFFFFFFFF
-# define CARES_MASK_UINT 0xFFFFFFFFFFFFFFFF
-#elif (SIZEOF_INT == 16)
-# define CARES_MASK_SINT 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-# define CARES_MASK_UINT 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-#else
-# error "SIZEOF_INT not defined"
-#endif
-
-#ifndef HAVE_LIMITS_H
-/* systems without <limits.h> we guess have 32 bit longs */
-#define CARES_MASK_SLONG 0x7FFFFFFFL
-#define CARES_MASK_ULONG 0xFFFFFFFFUL
+# define CARES_MASK_SINT 0x7FFFFFFF
+# define CARES_MASK_UINT 0xFFFFFFFF
+# define CARES_MASK_SLONG 0x7FFFFFFFL
+# define CARES_MASK_ULONG 0xFFFFFFFFUL
#else
-#define CARES_MASK_ULONG ULONG_MAX
-#define CARES_MASK_SLONG LONG_MAX
+# define CARES_MASK_SSHORT SHRT_MAX
+# define CARES_MASK_USHORT USHRT_MAX
+# define CARES_MASK_SINT INT_MAX
+# define CARES_MASK_UINT UINT_MAX
+# define CARES_MASK_SLONG LONG_MAX
+# define CARES_MASK_ULONG ULONG_MAX
#endif
/*