summaryrefslogtreecommitdiff
path: root/ares_nowarn.c
diff options
context:
space:
mode:
authorYu Jiung <jiung.yu@samsung.com>2016-11-10 16:24:08 +0900
committerYu Jiung <jiung.yu@samsung.com>2016-11-10 16:25:02 +0900
commit8166b0204b6945a4fdb89bbae0b0b7168a7cf6e8 (patch)
tree81f0750d91aa467df3ee81cf30d22a65db2e6685 /ares_nowarn.c
parentccccebb78520ec3a26a18370936516b12ae5d53a (diff)
parent45e88a8337839e5fd88519bc55467053d521c9f6 (diff)
downloadc-ares-196915eb4535a755c5005b5befd9d01b72120215.tar.gz
c-ares-196915eb4535a755c5005b5befd9d01b72120215.tar.bz2
c-ares-196915eb4535a755c5005b5befd9d01b72120215.zip
Conflicts: packaging/c-ares.spec Change-Id: I1ec10e394aed3ef19ee21fefbe3aba7d7a615c74
Diffstat (limited to 'ares_nowarn.c')
-rw-r--r--ares_nowarn.c59
1 files changed, 18 insertions, 41 deletions
diff --git a/ares_nowarn.c b/ares_nowarn.c
index a4dce89..7f9035c 100644
--- a/ares_nowarn.c
+++ b/ares_nowarn.c
@@ -1,5 +1,5 @@
-/* Copyright (C) 2010-2012 by Daniel Stenberg
+/* Copyright (C) 2010-2013 by Daniel Stenberg
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
@@ -21,6 +21,10 @@
# include <assert.h>
#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
#if defined(__INTEL_COMPILER) && defined(__unix__)
#ifdef HAVE_NETINET_IN_H
@@ -36,49 +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
-
-#if (CARES_SIZEOF_LONG == 2)
-# define CARES_MASK_SLONG 0x7FFFL
-# define CARES_MASK_ULONG 0xFFFFUL
-#elif (CARES_SIZEOF_LONG == 4)
-# define CARES_MASK_SLONG 0x7FFFFFFFL
-# define CARES_MASK_ULONG 0xFFFFFFFFUL
-#elif (CARES_SIZEOF_LONG == 8)
-# define CARES_MASK_SLONG 0x7FFFFFFFFFFFFFFFL
-# define CARES_MASK_ULONG 0xFFFFFFFFFFFFFFFFUL
-#elif (CARES_SIZEOF_LONG == 16)
-# define CARES_MASK_SLONG 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFL
-# define CARES_MASK_ULONG 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFUL
+# define CARES_MASK_SINT 0x7FFFFFFF
+# define CARES_MASK_UINT 0xFFFFFFFF
+# define CARES_MASK_SLONG 0x7FFFFFFFL
+# define CARES_MASK_ULONG 0xFFFFFFFFUL
#else
-# error "CARES_SIZEOF_LONG not defined"
+# 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
/*