From: Wouter Wijngaards Date: Tue, 24 Mar 2009 14:08:58 +0000 (+0000) Subject: 64bit types not handled well enough builtin. X-Git-Tag: release-1.3.0~71 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=25467d37e33a88965f004fd6d3d475d11dcb11be;p=thirdparty%2Funbound.git 64bit types not handled well enough builtin. git-svn-id: file:///svn/unbound/trunk@1552 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/config.h.in b/config.h.in index 6d2ce7f18..068e409ab 100644 --- a/config.h.in +++ b/config.h.in @@ -414,21 +414,6 @@ /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef was allowed, the - #define below would cause a syntax error. */ -#undef _UINT32_T - -/* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef was allowed, the - #define below would cause a syntax error. */ -#undef _UINT64_T - -/* Define for Solaris 2.5.1 so the uint8_t typedef from , - , or is not used. If the typedef was allowed, the - #define below would cause a syntax error. */ -#undef _UINT8_T - /* Define to empty if `const' does not conform to ANSI C. */ #undef const @@ -447,20 +432,16 @@ #undef inline #endif -/* Define to the type of a signed integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ +/* Define to `short' if does not define. */ #undef int16_t -/* Define to the type of a signed integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ +/* Define to `int' if does not define. */ #undef int32_t -/* Define to the type of a signed integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ +/* Define to `long long' if does not define. */ #undef int64_t -/* Define to the type of a signed integer type of width exactly 8 bits if such - a type exists and the standard includes do not define it. */ +/* Define to `signed char' if does not define. */ #undef int8_t /* Define to rpl_malloc if the replacement function should be used. */ @@ -490,20 +471,16 @@ /* Define to `int' if doesn't define. */ #undef uid_t -/* Define to the type of an unsigned integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ +/* Define to `unsigned short' if does not define. */ #undef uint16_t -/* Define to the type of an unsigned integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ +/* Define to `unsigned int' if does not define. */ #undef uint32_t -/* Define to the type of an unsigned integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ +/* Define to `unsigned long long' if does not define. */ #undef uint64_t -/* Define to the type of an unsigned integer type of width exactly 8 bits if - such a type exists and the standard includes do not define it. */ +/* Define to `unsigned char' if does not define. */ #undef uint8_t /* Define as `fork' if `vfork' does not work. */ diff --git a/configure b/configure index b7c0d5995..19c04379e 100755 --- a/configure +++ b/configure @@ -20492,50 +20492,13 @@ fi done -# check for types - - { echo "$as_me:$LINENO: checking for int8_t" >&5 +# check for types. +# Using own tests for int64* because autoconf builtin only give 32bit. +{ echo "$as_me:$LINENO: checking for int8_t" >&5 echo $ECHO_N "checking for int8_t... $ECHO_C" >&6; } -if test "${ac_cv_c_int8_t+set}" = set; then +if test "${ac_cv_type_int8_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_int8_t=no - for ac_type in 'int8_t' 'int' 'long int' \ - 'long long int' 'short int' 'signed char'; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (8 - 2)) - 1) * 2 + 1))]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20543,13 +20506,14 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef int8_t ac__type_new_; int main () { -static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (8 - 2)) - 1) * 2 + 1) - < ($ac_type) (((($ac_type) 1 << (8 - 2)) - 1) * 2 + 2))]; -test_array [0] = 0 - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -20571,85 +20535,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : + ac_cv_type_int8_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - case $ac_type in - int8_t) ac_cv_c_int8_t=yes ;; - *) ac_cv_c_int8_t=$ac_type ;; -esac - + ac_cv_type_int8_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_int8_t" != no && break - done -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_int8_t" >&5 -echo "${ECHO_T}$ac_cv_c_int8_t" >&6; } - case $ac_cv_c_int8_t in #( - no|yes) ;; #( - *) +{ echo "$as_me:$LINENO: result: $ac_cv_type_int8_t" >&5 +echo "${ECHO_T}$ac_cv_type_int8_t" >&6; } +if test $ac_cv_type_int8_t = yes; then + : +else cat >>confdefs.h <<_ACEOF -#define int8_t $ac_cv_c_int8_t +#define int8_t signed char _ACEOF -;; - esac +fi - { echo "$as_me:$LINENO: checking for int16_t" >&5 +{ echo "$as_me:$LINENO: checking for int16_t" >&5 echo $ECHO_N "checking for int16_t... $ECHO_C" >&6; } -if test "${ac_cv_c_int16_t+set}" = set; then +if test "${ac_cv_type_int16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_int16_t=no - for ac_type in 'int16_t' 'int' 'long int' \ - 'long long int' 'short int' 'signed char'; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (16 - 2)) - 1) * 2 + 1))]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20657,13 +20569,14 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef int16_t ac__type_new_; int main () { -static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (16 - 2)) - 1) * 2 + 1) - < ($ac_type) (((($ac_type) 1 << (16 - 2)) - 1) * 2 + 2))]; -test_array [0] = 0 - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -20685,85 +20598,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : + ac_cv_type_int16_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - case $ac_type in - int16_t) ac_cv_c_int16_t=yes ;; - *) ac_cv_c_int16_t=$ac_type ;; -esac - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - + ac_cv_type_int16_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_int16_t" != no && break - done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_int16_t" >&5 -echo "${ECHO_T}$ac_cv_c_int16_t" >&6; } - case $ac_cv_c_int16_t in #( - no|yes) ;; #( - *) +{ echo "$as_me:$LINENO: result: $ac_cv_type_int16_t" >&5 +echo "${ECHO_T}$ac_cv_type_int16_t" >&6; } +if test $ac_cv_type_int16_t = yes; then + : +else cat >>confdefs.h <<_ACEOF -#define int16_t $ac_cv_c_int16_t +#define int16_t short _ACEOF -;; - esac +fi - { echo "$as_me:$LINENO: checking for int32_t" >&5 +{ echo "$as_me:$LINENO: checking for int32_t" >&5 echo $ECHO_N "checking for int32_t... $ECHO_C" >&6; } -if test "${ac_cv_c_int32_t+set}" = set; then +if test "${ac_cv_type_int32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_int32_t=no - for ac_type in 'int32_t' 'int' 'long int' \ - 'long long int' 'short int' 'signed char'; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 1))]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20771,13 +20632,14 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef int32_t ac__type_new_; int main () { -static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 1) - < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 2))]; -test_array [0] = 0 - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -20799,85 +20661,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : + ac_cv_type_int32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - case $ac_type in - int32_t) ac_cv_c_int32_t=yes ;; - *) ac_cv_c_int32_t=$ac_type ;; -esac - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - + ac_cv_type_int32_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_int32_t" != no && break - done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_int32_t" >&5 -echo "${ECHO_T}$ac_cv_c_int32_t" >&6; } - case $ac_cv_c_int32_t in #( - no|yes) ;; #( - *) +{ echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_int32_t" >&6; } +if test $ac_cv_type_int32_t = yes; then + : +else cat >>confdefs.h <<_ACEOF -#define int32_t $ac_cv_c_int32_t +#define int32_t int _ACEOF -;; - esac +fi - { echo "$as_me:$LINENO: checking for int64_t" >&5 +{ echo "$as_me:$LINENO: checking for int64_t" >&5 echo $ECHO_N "checking for int64_t... $ECHO_C" >&6; } -if test "${ac_cv_c_int64_t+set}" = set; then +if test "${ac_cv_type_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_int64_t=no - for ac_type in 'int64_t' 'int' 'long int' \ - 'long long int' 'short int' 'signed char'; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1))]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20885,13 +20695,14 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef int64_t ac__type_new_; int main () { -static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1) - < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 2))]; -test_array [0] = 0 - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -20913,64 +20724,48 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : + ac_cv_type_int64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - case $ac_type in - int64_t) ac_cv_c_int64_t=yes ;; - *) ac_cv_c_int64_t=$ac_type ;; -esac - + ac_cv_type_int64_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_int64_t" != no && break - done -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_int64_t" >&5 -echo "${ECHO_T}$ac_cv_c_int64_t" >&6; } - case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) +{ echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_int64_t" >&6; } +if test $ac_cv_type_int64_t = yes; then + : +else cat >>confdefs.h <<_ACEOF -#define int64_t $ac_cv_c_int64_t +#define int64_t long long _ACEOF -;; - esac +fi - { echo "$as_me:$LINENO: checking for uint8_t" >&5 +{ echo "$as_me:$LINENO: checking for uint8_t" >&5 echo $ECHO_N "checking for uint8_t... $ECHO_C" >&6; } -if test "${ac_cv_c_uint8_t+set}" = set; then +if test "${ac_cv_type_uint8_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_uint8_t=no - for ac_type in 'uint8_t' 'unsigned int' 'unsigned long int' \ - 'unsigned long long int' 'unsigned short int' 'unsigned char'; do - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef uint8_t ac__type_new_; int main () { -static int test_array [1 - 2 * !(($ac_type) -1 >> (8 - 1) == 1)]; -test_array [0] = 0 - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -20992,61 +20787,48 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - case $ac_type in - uint8_t) ac_cv_c_uint8_t=yes ;; - *) ac_cv_c_uint8_t=$ac_type ;; -esac - + ac_cv_type_uint8_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_type_uint8_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_uint8_t" != no && break - done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_uint8_t" >&5 -echo "${ECHO_T}$ac_cv_c_uint8_t" >&6; } - case $ac_cv_c_uint8_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<\_ACEOF -#define _UINT8_T 1 -_ACEOF - +{ echo "$as_me:$LINENO: result: $ac_cv_type_uint8_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint8_t" >&6; } +if test $ac_cv_type_uint8_t = yes; then + : +else cat >>confdefs.h <<_ACEOF -#define uint8_t $ac_cv_c_uint8_t +#define uint8_t unsigned char _ACEOF -;; - esac +fi - { echo "$as_me:$LINENO: checking for uint16_t" >&5 +{ echo "$as_me:$LINENO: checking for uint16_t" >&5 echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6; } -if test "${ac_cv_c_uint16_t+set}" = set; then +if test "${ac_cv_type_uint16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_uint16_t=no - for ac_type in 'uint16_t' 'unsigned int' 'unsigned long int' \ - 'unsigned long long int' 'unsigned short int' 'unsigned char'; do - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef uint16_t ac__type_new_; int main () { -static int test_array [1 - 2 * !(($ac_type) -1 >> (16 - 1) == 1)]; -test_array [0] = 0 - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -21068,57 +20850,48 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - case $ac_type in - uint16_t) ac_cv_c_uint16_t=yes ;; - *) ac_cv_c_uint16_t=$ac_type ;; -esac - + ac_cv_type_uint16_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_type_uint16_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_uint16_t" != no && break - done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_uint16_t" >&5 -echo "${ECHO_T}$ac_cv_c_uint16_t" >&6; } - case $ac_cv_c_uint16_t in #( - no|yes) ;; #( - *) - +{ echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint16_t" >&6; } +if test $ac_cv_type_uint16_t = yes; then + : +else cat >>confdefs.h <<_ACEOF -#define uint16_t $ac_cv_c_uint16_t +#define uint16_t unsigned short _ACEOF -;; - esac +fi - { echo "$as_me:$LINENO: checking for uint32_t" >&5 +{ echo "$as_me:$LINENO: checking for uint32_t" >&5 echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6; } -if test "${ac_cv_c_uint32_t+set}" = set; then +if test "${ac_cv_type_uint32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_uint32_t=no - for ac_type in 'uint32_t' 'unsigned int' 'unsigned long int' \ - 'unsigned long long int' 'unsigned short int' 'unsigned char'; do - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef uint32_t ac__type_new_; int main () { -static int test_array [1 - 2 * !(($ac_type) -1 >> (32 - 1) == 1)]; -test_array [0] = 0 - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -21140,61 +20913,48 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - case $ac_type in - uint32_t) ac_cv_c_uint32_t=yes ;; - *) ac_cv_c_uint32_t=$ac_type ;; -esac - + ac_cv_type_uint32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_type_uint32_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_uint32_t" != no && break - done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5 -echo "${ECHO_T}$ac_cv_c_uint32_t" >&6; } - case $ac_cv_c_uint32_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<\_ACEOF -#define _UINT32_T 1 -_ACEOF - +{ echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint32_t" >&6; } +if test $ac_cv_type_uint32_t = yes; then + : +else cat >>confdefs.h <<_ACEOF -#define uint32_t $ac_cv_c_uint32_t +#define uint32_t unsigned int _ACEOF -;; - esac +fi - { echo "$as_me:$LINENO: checking for uint64_t" >&5 +{ echo "$as_me:$LINENO: checking for uint64_t" >&5 echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } -if test "${ac_cv_c_uint64_t+set}" = set; then +if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_uint64_t=no - for ac_type in 'uint64_t' 'unsigned int' 'unsigned long int' \ - 'unsigned long long int' 'unsigned short int' 'unsigned char'; do - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef uint64_t ac__type_new_; int main () { -static int test_array [1 - 2 * !(($ac_type) -1 >> (64 - 1) == 1)]; -test_array [0] = 0 - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -21216,38 +20976,27 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - case $ac_type in - uint64_t) ac_cv_c_uint64_t=yes ;; - *) ac_cv_c_uint64_t=$ac_type ;; -esac - + ac_cv_type_uint64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_type_uint64_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_uint64_t" != no && break - done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_c_uint64_t" >&6; } - case $ac_cv_c_uint64_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<\_ACEOF -#define _UINT64_T 1 -_ACEOF - +{ echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6; } +if test $ac_cv_type_uint64_t = yes; then + : +else cat >>confdefs.h <<_ACEOF -#define uint64_t $ac_cv_c_uint64_t +#define uint64_t unsigned long long _ACEOF -;; - esac + +fi { echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } diff --git a/configure.ac b/configure.ac index 95c03e412..b279c71c6 100644 --- a/configure.ac +++ b/configure.ac @@ -173,17 +173,18 @@ ACX_LIBTOOL_C_ONLY # Checks for header files. AC_CHECK_HEADERS([stdarg.h stdbool.h netinet/in.h sys/param.h sys/socket.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h],,, [AC_INCLUDES_DEFAULT]) -# check for types -AC_TYPE_INT8_T -AC_TYPE_INT16_T -AC_TYPE_INT32_T -AC_TYPE_INT64_T -AC_TYPE_UINT8_T -AC_TYPE_UINT16_T -AC_TYPE_UINT32_T -AC_TYPE_UINT64_T +# check for types. +# Using own tests for int64* because autoconf builtin only give 32bit. +AC_CHECK_TYPE(int8_t, signed char) +AC_CHECK_TYPE(int16_t, short) +AC_CHECK_TYPE(int32_t, int) +AC_CHECK_TYPE(int64_t, long long) +AC_CHECK_TYPE(uint8_t, unsigned char) +AC_CHECK_TYPE(uint16_t, unsigned short) +AC_CHECK_TYPE(uint32_t, unsigned int) +AC_CHECK_TYPE(uint64_t, unsigned long long) AC_TYPE_SIZE_T -AC_TYPE_SSIZE_T +AC_CHECK_TYPE(ssize_t, int) AC_TYPE_UID_T AC_TYPE_PID_T AC_TYPE_OFF_T