From 7bdae7be4f46871465272a0620e635cd3d42c9c6 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 13 Aug 2008 18:57:48 +0000 Subject: Ensure that the compiler 'knows' the 'long' type in CURL_CONFIGURE_LONG --- acinclude.m4 | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 3f100a86f..b2e4995df 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -3613,6 +3613,30 @@ _EOF ]) +dnl CURL_INCLUDES_INTTYPES +dnl ------------------------------------------------- +dnl Set up variable with list of headers that must be +dnl included when inttypes.h is to be included. + +AC_DEFUN([CURL_INCLUDES_INTTYPES], [ +curl_includes_inttypes="\ +/* includes start */ +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +/* includes end */" + AC_CHECK_HEADERS( + sys/types.h stdint.h inttypes.h, + [], [], [$curl_includes_inttypes]) +]) + + dnl CURL_CONFIGURE_LONG dnl ------------------------------------------------- dnl Find out the size of long as reported by sizeof() and define @@ -3622,6 +3646,7 @@ dnl The size of long is a build time characteristic and as such dnl must be recorded in curlbuild.h AC_DEFUN([CURL_CONFIGURE_LONG], [ + AC_REQUIRE([CURL_INCLUDES_INTTYPES])dnl if test ! -z "$ac_cv_sizeof_long"; then AC_MSG_WARN([Use CURL-CONFIGURE-LONG to check the size of long first]) fi @@ -3631,6 +3656,7 @@ AC_DEFUN([CURL_CONFIGURE_LONG], [ if test "$curl_sizeof_long" = "unknown"; then AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ + $curl_includes_inttypes typedef char dummy_arr[sizeof(long) == $tmp_size ? 1 : -1]; ]],[[ dummy_arr[1] = (long)1; @@ -3650,30 +3676,6 @@ AC_DEFUN([CURL_CONFIGURE_LONG], [ ]) -dnl CURL_INCLUDES_INTTYPES -dnl ------------------------------------------------- -dnl Set up variable with list of headers that must be -dnl included when inttypes.h is to be included. - -AC_DEFUN([CURL_INCLUDES_INTTYPES], [ -curl_includes_inttypes="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -/* includes end */" - AC_CHECK_HEADERS( - sys/types.h stdint.h inttypes.h, - [], [], [$curl_includes_inttypes]) -]) - - dnl DO_CURL_OFF_T_CHECK (TYPE, SIZE) dnl ------------------------------------------------- dnl Internal macro for CURL_CONFIGURE_CURL_OFF_T -- cgit v1.2.3