diff --git a/acinclude.m4 b/acinclude.m4 index ec7b0b2..c255198 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1743,24 +1743,6 @@ cat >>confdefs.h <<_EOF _EOF ]) - -dnl CARES_CONFIGURE_LONG -dnl ------------------------------------------------- -dnl Find out the size of long as reported by sizeof() and define -dnl CARES_SIZEOF_LONG as appropriate to be used in template file -dnl ares_build.h.in to properly configure the library. -dnl The size of long is a build time characteristic and as such -dnl must be recorded in ares_build.h - -AC_DEFUN([CARES_CONFIGURE_LONG], [ - if test -z "$ac_cv_sizeof_long" || - test "$ac_cv_sizeof_long" -eq "0"; then - AC_MSG_ERROR([cannot find out size of long.]) - fi - CARES_DEFINE_UNQUOTED([CARES_SIZEOF_LONG], [$ac_cv_sizeof_long]) -]) - - dnl CARES_CONFIGURE_ARES_SOCKLEN_T dnl ------------------------------------------------- dnl Find out suitable ares_socklen_t data type definition and size, making diff --git a/ares_nowarn.c b/ares_nowarn.c index a4dce89..d4bd272 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 #endif +#ifdef HAVE_LIMITS_H +#include +#endif + #if defined(__INTEL_COMPILER) && defined(__unix__) #ifdef HAVE_NETINET_IN_H @@ -65,20 +69,13 @@ # 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 +#ifndef HAVE_LIMITS_H +/* systems without we guess have 32 bit longs */ +#define CARES_MASK_SLONG 0x7FFFFFFFL +#define CARES_MASK_ULONG 0xFFFFFFFFUL #else -# error "CARES_SIZEOF_LONG not defined" +#define CARES_MASK_ULONG ULONG_MAX +#define CARES_MASK_SLONG LONG_MAX #endif /* diff --git a/configure.ac b/configure.ac index 9492d7b..0ef8bd4 100644 --- a/configure.ac +++ b/configure.ac @@ -457,7 +457,6 @@ AC_CHECK_SIZEOF(size_t) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(short) -CARES_CONFIGURE_LONG AC_CHECK_SIZEOF(time_t) AC_CHECK_TYPE(long long,