ab2c75f
--- ares_build.h.in
ab2c75f
+++ ares_build.h.in
ab2c75f
@@ -96,7 +96,14 @@
ab2c75f
 #endif
ab2c75f
 
ab2c75f
 /* The size of `long', as computed by sizeof. */
ab2c75f
-#undef CARES_SIZEOF_LONG
ab2c75f
+#include <bits/wordsize.h>
ab2c75f
+#if __WORDSIZE == 32
ab2c75f
+#define CARES_SIZEOF_LONG 4
ab2c75f
+#elif __WORDSIZE == 64
ab2c75f
+#define CARES_SIZEOF_LONG 8
ab2c75f
+#else
ab2c75f
+#error "Unknown word size"
ab2c75f
+#endif
ab2c75f
 
ab2c75f
 /* Integral data type used for ares_socklen_t. */
ab2c75f
 #undef CARES_TYPEOF_ARES_SOCKLEN_T
ab2c75f
--- configure.ac
ab2c75f
+++ configure.ac
ab2c75f
@@ -468,7 +468,6 @@ AC_CHECK_SIZEOF(size_t)
ab2c75f
 AC_CHECK_SIZEOF(long)
ab2c75f
 AC_CHECK_SIZEOF(int)
ab2c75f
 AC_CHECK_SIZEOF(short)
ab2c75f
-CARES_CONFIGURE_LONG
ab2c75f
 AC_CHECK_SIZEOF(time_t)
ab2c75f
 
ab2c75f
 AC_CHECK_TYPE(long long,
ab2c75f
--- configure
ab2c75f
+++ configure
ab2c75f
@@ -18096,17 +18096,6 @@
ab2c75f
 _ACEOF
ab2c75f
 
ab2c75f
 
ab2c75f
-
ab2c75f
-  if test -z "$ac_cv_sizeof_long" ||
ab2c75f
-    test "$ac_cv_sizeof_long" -eq "0"; then
ab2c75f
-    as_fn_error "cannot find out size of long." "$LINENO" 5
ab2c75f
-  fi
ab2c75f
-
ab2c75f
-cat >>confdefs.h <<_EOF
ab2c75f
-#define CARES_SIZEOF_LONG $ac_cv_sizeof_long
ab2c75f
-_EOF
ab2c75f
-
ab2c75f
-
ab2c75f
 # The cast to long int works around a bug in the HP C Compiler
ab2c75f
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
ab2c75f
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.