diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-26 08:19:02 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-26 08:19:02 +0000 |
commit | 1c8ad86a7b27987d2d1d620c665bfb6a28d5325d (patch) | |
tree | e28b8ab33b2de7eaa12479bdb8dfb1291a7f26d0 | |
parent | a142dffd4a046460b3e2d05481b93d5263aef6a5 (diff) | |
download | gcc-1c8ad86a7b27987d2d1d620c665bfb6a28d5325d.tar.gz |
2014-05-26 Richard Biener <rguenther@suse.de>
libcpp/
* configure.ac: Remove long long and __int64 type checks,
add check for uint64_t and fail if that wasn't found.
* include/cpplib.h (cpp_num_part): Use uint64_t.
* config.in: Regenerate.
* configure: Likewise.
gcc/
* configure.ac: Drop __int64 type check. Insist that we
found uint64_t and int64_t.
* hwint.h (HOST_BITS_PER___INT64): Remove.
(HOST_BITS_PER_WIDE_INT): Define to 64 and remove
__int64 case.
(HOST_WIDE_INT_PRINT_*): Remove 32bit case.
(HOST_WIDEST_INT*): Define to HOST_WIDE_INT*.
(HOST_WIDEST_FAST_INT): Remove __int64 case.
* vmsdbg.h (struct _DST_SRC_COMMAND): Use int64_t
for dst_q_src_df_rms_cdt.
* configure: Regenerate.
* config.in: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210928 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/config.in | 16 | ||||
-rwxr-xr-x | gcc/configure | 50 | ||||
-rw-r--r-- | gcc/configure.ac | 6 | ||||
-rw-r--r-- | gcc/hwint.h | 101 | ||||
-rw-r--r-- | gcc/vmsdbg.h | 8 | ||||
-rw-r--r-- | libcpp/ChangeLog | 8 | ||||
-rw-r--r-- | libcpp/config.in | 21 | ||||
-rwxr-xr-x | libcpp/configure | 141 | ||||
-rw-r--r-- | libcpp/configure.ac | 6 | ||||
-rw-r--r-- | libcpp/include/cpplib.h | 18 |
11 files changed, 138 insertions, 252 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cdd447791ba..d994917ac73 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2014-05-26 Richard Biener <rguenther@suse.de> + + * configure.ac: Drop __int64 type check. Insist that we + found uint64_t and int64_t. + * hwint.h (HOST_BITS_PER___INT64): Remove. + (HOST_BITS_PER_WIDE_INT): Define to 64 and remove + __int64 case. + (HOST_WIDE_INT_PRINT_*): Remove 32bit case. + (HOST_WIDEST_INT*): Define to HOST_WIDE_INT*. + (HOST_WIDEST_FAST_INT): Remove __int64 case. + * vmsdbg.h (struct _DST_SRC_COMMAND): Use int64_t + for dst_q_src_df_rms_cdt. + * configure: Regenerate. + * config.in: Likewise. + 2014-05-26 Michael Tautschnig <mt@debian.org> PR target/61249 diff --git a/gcc/config.in b/gcc/config.in index f03ed8288a1..a3d169be1cb 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1655,12 +1655,6 @@ #endif -/* Define to 1 if the system has the type `__int64'. */ -#ifndef USED_FOR_TARGET -#undef HAVE___INT64 -#endif - - /* Define if cloog is in use. */ #ifndef USED_FOR_TARGET #undef HAVE_cloog @@ -1807,12 +1801,6 @@ #endif -/* The size of `__int64', as computed by sizeof. */ -#ifndef USED_FOR_TARGET -#undef SIZEOF___INT64 -#endif - - /* Define to 1 if you have the ANSI C header files. */ #ifndef USED_FOR_TARGET #undef STDC_HEADERS @@ -1866,8 +1854,8 @@ #endif -/* Define to 1 if the 'long long' (or '__int64') is wider than 'long' but - still efficiently supported by the host hardware. */ +/* Define to 1 if the 'long long' type is wider than 'long' but still + efficiently supported by the host hardware. */ #ifndef USED_FOR_TARGET #undef USE_LONG_LONG_FOR_WIDEST_FAST_INT #endif diff --git a/gcc/configure b/gcc/configure index 1440d7e7d34..fe76232a56d 100755 --- a/gcc/configure +++ b/gcc/configure @@ -5862,49 +5862,6 @@ _ACEOF fi -ac_fn_c_check_type "$LINENO" "__int64" "ac_cv_type___int64" "$ac_includes_default" -if test "x$ac_cv_type___int64" = x""yes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE___INT64 1 -_ACEOF - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5 -$as_echo_n "checking size of __int64... " >&6; } -if test "${ac_cv_sizeof___int64+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" "$ac_includes_default"; then : - -else - if test "$ac_cv_type___int64" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (__int64) -See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof___int64=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int64" >&5 -$as_echo "$ac_cv_sizeof___int64" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF___INT64 $ac_cv_sizeof___int64 -_ACEOF - - -fi - ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" case $ac_cv_c_int8_t in #( no|yes) ;; #( @@ -6269,6 +6226,9 @@ fi +if test x"$ac_cv_c_uint64_t" = x"no" -o x"$ac_cv_c_int64_t" = x"no"; then + as_fn_error "uint64_t or int64_t not found" "$LINENO" 5 +fi # --------------------- # Warnings and checking @@ -17988,7 +17948,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17991 "configure" +#line 17951 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18094,7 +18054,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18097 "configure" +#line 18057 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 281ce8e06a1..0f8566f9336 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -311,8 +311,10 @@ AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_TYPES([long long], [AC_CHECK_SIZEOF(long long)]) -AC_CHECK_TYPES([__int64], [AC_CHECK_SIZEOF(__int64)]) GCC_STDINT_TYPES +if test x"$ac_cv_c_uint64_t" = x"no" -o x"$ac_cv_c_int64_t" = x"no"; then + AC_MSG_ERROR([uint64_t or int64_t not found]) +fi # --------------------- # Warnings and checking @@ -1374,7 +1376,7 @@ fi if test x$use_long_long_for_widest_fast_int = xyes; then AC_DEFINE(USE_LONG_LONG_FOR_WIDEST_FAST_INT, 1, -[Define to 1 if the 'long long' (or '__int64') is wider than 'long' but still +[Define to 1 if the 'long long' type is wider than 'long' but still efficiently supported by the host hardware.]) fi diff --git a/gcc/hwint.h b/gcc/hwint.h index 4cc4614b4ea..6d2df9d6a99 100644 --- a/gcc/hwint.h +++ b/gcc/hwint.h @@ -44,40 +44,28 @@ extern char sizeof_long_long_must_be_8[sizeof (long long) == 8 ? 1 : -1]; #ifdef HAVE_LONG_LONG # define HOST_BITS_PER_LONGLONG (CHAR_BIT * SIZEOF_LONG_LONG) #endif -#ifdef HAVE___INT64 -# define HOST_BITS_PER___INT64 (CHAR_BIT * SIZEOF___INT64) -#endif -/* Set HOST_WIDE_INT. This should be the widest efficient host - integer type. It can be 32 or 64 bits, except that if we are - targeting a machine with 64-bit size_t then it has to be 64 bits. +/* Set HOST_WIDE_INT, this should be always 64 bits. With a sane ABI, 'long' is the largest efficient host integer type. - Thus, we use that unless we have to use 'long long' or '__int64' - because we're targeting a 64-bit machine from a 32-bit host. */ + Thus, we use that unless we have to use 'long long' + because we're on a 32-bit host. */ -#if HOST_BITS_PER_LONG >= 64 -# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG +#define HOST_BITS_PER_WIDE_INT 64 +#if HOST_BITS_PER_LONG == 64 # define HOST_WIDE_INT long # define HOST_WIDE_INT_C(X) X ## L #else -# if HOST_BITS_PER_LONGLONG >= 64 -# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONGLONG +# if HOST_BITS_PER_LONGLONG == 64 # define HOST_WIDE_INT long long # define HOST_WIDE_INT_C(X) X ## LL # else -# if HOST_BITS_PER___INT64 >= 64 -# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER___INT64 -# define HOST_WIDE_INT __int64 -# define HOST_WIDE_INT_C(X) X ## i64 -# else - #error "Unable to find a suitable type for HOST_WIDE_INT" -# endif + #error "Unable to find a suitable type for HOST_WIDE_INT" # endif #endif /* Print support for half a host wide int. */ -#define HOST_BITS_PER_HALF_WIDE_INT (HOST_BITS_PER_WIDE_INT / 2) +#define HOST_BITS_PER_HALF_WIDE_INT 32 #if HOST_BITS_PER_HALF_WIDE_INT == HOST_BITS_PER_LONG # define HOST_HALF_WIDE_INT long # define HOST_HALF_WIDE_INT_PRINT HOST_LONG_FORMAT @@ -126,23 +114,15 @@ typedef HOST_WIDE_INT __gcc_host_wide_int__; #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG # define HOST_WIDE_INT_PRINT HOST_LONG_FORMAT # define HOST_WIDE_INT_PRINT_C "L" - /* 'long' might be 32 or 64 bits, and the number of leading zeroes - must be tweaked accordingly. */ -# if HOST_BITS_PER_WIDE_INT == 64 -# define HOST_WIDE_INT_PRINT_DOUBLE_HEX \ - "0x%" HOST_LONG_FORMAT "x%016" HOST_LONG_FORMAT "x" -# define HOST_WIDE_INT_PRINT_PADDED_HEX \ - "%016" HOST_LONG_FORMAT "x" -# else -# define HOST_WIDE_INT_PRINT_DOUBLE_HEX \ - "0x%" HOST_LONG_FORMAT "x%08" HOST_LONG_FORMAT "x" -# define HOST_WIDE_INT_PRINT_PADDED_HEX \ - "%08" HOST_LONG_FORMAT "x" -# endif + /* HOST_BITS_PER_WIDE_INT is 64 bits. */ +# define HOST_WIDE_INT_PRINT_DOUBLE_HEX \ + "0x%" HOST_LONG_FORMAT "x%016" HOST_LONG_FORMAT "x" +# define HOST_WIDE_INT_PRINT_PADDED_HEX \ + "%016" HOST_LONG_FORMAT "x" #else # define HOST_WIDE_INT_PRINT HOST_LONG_LONG_FORMAT # define HOST_WIDE_INT_PRINT_C "LL" - /* We can assume that 'long long' is at least 64 bits. */ + /* HOST_BITS_PER_WIDE_INT is 64 bits. */ # define HOST_WIDE_INT_PRINT_DOUBLE_HEX \ "0x%" HOST_LONG_LONG_FORMAT "x%016" HOST_LONG_LONG_FORMAT "x" # define HOST_WIDE_INT_PRINT_PADDED_HEX \ @@ -155,42 +135,17 @@ typedef HOST_WIDE_INT __gcc_host_wide_int__; #define HOST_WIDE_INT_PRINT_HEX "%#" HOST_WIDE_INT_PRINT "x" #define HOST_WIDE_INT_PRINT_HEX_PURE "%" HOST_WIDE_INT_PRINT "x" -/* Set HOST_WIDEST_INT. This is a 64-bit type unless the compiler - in use has no 64-bit type at all; in that case it's 32 bits. */ - -#if HOST_BITS_PER_WIDE_INT >= 64 \ - || (HOST_BITS_PER_LONGLONG < 64 && HOST_BITS_PER___INT64 < 64) -# define HOST_WIDEST_INT HOST_WIDE_INT -# define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_WIDE_INT -# define HOST_WIDEST_INT_PRINT HOST_WIDE_INT_PRINT -# define HOST_WIDEST_INT_PRINT_DEC HOST_WIDE_INT_PRINT_DEC -# define HOST_WIDEST_INT_PRINT_DEC_C HOST_WIDE_INT_PRINT_DEC_C -# define HOST_WIDEST_INT_PRINT_UNSIGNED HOST_WIDE_INT_PRINT_UNSIGNED -# define HOST_WIDEST_INT_PRINT_HEX HOST_WIDE_INT_PRINT_HEX -# define HOST_WIDEST_INT_PRINT_DOUBLE_HEX HOST_WIDE_INT_PRINT_DOUBLE_HEX -# define HOST_WIDEST_INT_C(X) HOST_WIDE_INT (X) -#else -# if HOST_BITS_PER_LONGLONG >= 64 -# define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONGLONG -# define HOST_WIDEST_INT long long -# define HOST_WIDEST_INT_C(X) X ## LL -# else -# if HOST_BITS_PER___INT64 >= 64 -# define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER___INT64 -# define HOST_WIDEST_INT __int64 -# define HOST_WIDEST_INT_C(X) X ## i64 -# else - #error "This line should be impossible to reach" -# endif -# endif -# define HOST_WIDEST_INT_PRINT HOST_LONG_LONG_FORMAT -# define HOST_WIDEST_INT_PRINT_DEC "%" HOST_LONG_LONG_FORMAT "d" -# define HOST_WIDEST_INT_PRINT_DEC_C "%" HOST_LONG_LONG_FORMAT "dLL" -# define HOST_WIDEST_INT_PRINT_UNSIGNED "%" HOST_LONG_LONG_FORMAT "u" -# define HOST_WIDEST_INT_PRINT_HEX "%#" HOST_LONG_LONG_FORMAT "x" -# define HOST_WIDEST_INT_PRINT_DOUBLE_HEX \ - "0x%" HOST_LONG_LONG_FORMAT "x%016" HOST_LONG_LONG_FORMAT "x" -#endif +/* Set HOST_WIDEST_INT. This is a 64-bit type. */ + +#define HOST_WIDEST_INT HOST_WIDE_INT +#define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_WIDE_INT +#define HOST_WIDEST_INT_PRINT HOST_WIDE_INT_PRINT +#define HOST_WIDEST_INT_PRINT_DEC HOST_WIDE_INT_PRINT_DEC +#define HOST_WIDEST_INT_PRINT_DEC_C HOST_WIDE_INT_PRINT_DEC_C +#define HOST_WIDEST_INT_PRINT_UNSIGNED HOST_WIDE_INT_PRINT_UNSIGNED +#define HOST_WIDEST_INT_PRINT_HEX HOST_WIDE_INT_PRINT_HEX +#define HOST_WIDEST_INT_PRINT_DOUBLE_HEX HOST_WIDE_INT_PRINT_DOUBLE_HEX +#define HOST_WIDEST_INT_C(X) HOST_WIDE_INT (X) /* Define HOST_WIDEST_FAST_INT to the widest integer type supported efficiently in hardware. (That is, the widest integer type that fits @@ -203,12 +158,8 @@ typedef HOST_WIDE_INT __gcc_host_wide_int__; # ifdef HAVE_LONG_LONG # define HOST_WIDEST_FAST_INT long long # define HOST_BITS_PER_WIDEST_FAST_INT HOST_BITS_PER_LONGLONG -# elif defined (HAVE___INT64) -# define HOST_WIDEST_FAST_INT __int64 -# define HOST_BITS_PER_WIDEST_FAST_INT HOST_BITS_PER___INT64 # else -# error "Your host said it wanted to use long long or __int64 but neither" -# error "exist" +# error "Your host said it wanted to use long long but that does not exist" # endif #else # define HOST_WIDEST_FAST_INT long diff --git a/gcc/vmsdbg.h b/gcc/vmsdbg.h index db1a416a8ba..8e656cee6cd 100644 --- a/gcc/vmsdbg.h +++ b/gcc/vmsdbg.h @@ -216,13 +216,7 @@ typedef struct _DST_SRC_COMMAND unsigned char dst_b_src_df_length; unsigned char dst_b_src_df_flags; unsigned short int dst_w_src_df_fileid; -#ifdef HAVE_LONG_LONG - long long dst_q_src_df_rms_cdt; -#else -#ifdef HAVE___INT64 - __int64 dst_q_src_df_rms_cdt; -#endif -#endif + int64_t dst_q_src_df_rms_cdt; unsigned int dst_l_src_df_rms_ebk; unsigned short int dst_w_src_df_rms_ffb; unsigned char dst_b_src_df_rms_rfo; diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 323a75786a6..8288423941d 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,11 @@ +2014-05-26 Richard Biener <rguenther@suse.de> + + * configure.ac: Remove long long and __int64 type checks, + add check for uint64_t and fail if that wasn't found. + * include/cpplib.h (cpp_num_part): Use uint64_t. + * config.in: Regenerate. + * configure: Likewise. + 2014-05-21 Marek Polacek <polacek@redhat.com> PR c/61212 diff --git a/libcpp/config.in b/libcpp/config.in index 1d69a75a2df..8df00ec2357 100644 --- a/libcpp/config.in +++ b/libcpp/config.in @@ -180,9 +180,6 @@ /* Define to 1 if you have the <locale.h> header file. */ #undef HAVE_LOCALE_H -/* Define to 1 if the system has the type `long long'. */ -#undef HAVE_LONG_LONG - /* Define to 1 if you have the <memory.h> header file. */ #undef HAVE_MEMORY_H @@ -231,9 +228,6 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H -/* Define to 1 if the system has the type `__int64'. */ -#undef HAVE___INT64 - /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST @@ -264,12 +258,6 @@ /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG -/* The size of `long long', as computed by sizeof. */ -#undef SIZEOF_LONG_LONG - -/* The size of `__int64', as computed by sizeof. */ -#undef SIZEOF___INT64 - /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. @@ -340,6 +328,11 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE +/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>, + <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT64_T + /* Define to empty if `const' does not conform to ANSI C. */ #undef const @@ -361,6 +354,10 @@ /* Define to `int' if <sys/types.h> does not define. */ #undef ssize_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. */ +#undef uint64_t + /* Define to the type of an unsigned integer type wide enough to hold a pointer, if such a type exists, and if the system does not define it. */ #undef uintptr_t diff --git a/libcpp/configure b/libcpp/configure index 6b0f6dc4a72..096ac8b5f21 100755 --- a/libcpp/configure +++ b/libcpp/configure @@ -1822,6 +1822,58 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_type +# ac_fn_c_find_uintX_t LINENO BITS VAR +# ------------------------------------ +# Finds an unsigned integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_uintX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +$as_echo_n "checking for uint$2_t... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(($ac_type) -1 >> ($2 - 1) == 1)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + case $ac_type in #( + uint$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + eval as_val=\$$3 + if test "x$as_val" = x""no; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_find_uintX_t + # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes @@ -5566,92 +5618,23 @@ _ACEOF fi -ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" -if test "x$ac_cv_type_long_long" = x""yes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_LONG_LONG 1 -_ACEOF - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } -if test "${ac_cv_sizeof_long_long+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (long long) -See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_long_long=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -_ACEOF - - -fi - -ac_fn_c_check_type "$LINENO" "__int64" "ac_cv_type___int64" "$ac_includes_default" -if test "x$ac_cv_type___int64" = x""yes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE___INT64 1 -_ACEOF - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5 -$as_echo_n "checking size of __int64... " >&6; } -if test "${ac_cv_sizeof___int64+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" "$ac_includes_default"; then : - -else - if test "$ac_cv_type___int64" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (__int64) -See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof___int64=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int64" >&5 -$as_echo "$ac_cv_sizeof___int64" >&6; } +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) +$as_echo "#define _UINT64_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF -#define SIZEOF___INT64 $ac_cv_sizeof___int64 +#define uint64_t $ac_cv_c_uint64_t _ACEOF +;; + esac - +if test x"$ac_cv_c_uint64_t" = x"no"; then + as_fn_error "uint64_t not found" "$LINENO" 5 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test "${ac_cv_struct_tm+set}" = set; then : diff --git a/libcpp/configure.ac b/libcpp/configure.ac index 93616add3bd..5f008a4a67f 100644 --- a/libcpp/configure.ac +++ b/libcpp/configure.ac @@ -64,8 +64,10 @@ AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_TYPE_UINTPTR_T AC_CHECK_TYPE(ptrdiff_t, int) -AC_CHECK_TYPES([long long], [AC_CHECK_SIZEOF(long long)]) -AC_CHECK_TYPES([__int64], [AC_CHECK_SIZEOF(__int64)]) +AC_TYPE_UINT64_T +if test x"$ac_cv_c_uint64_t" = x"no"; then + AC_MSG_ERROR([uint64_t not found]) +fi AC_STRUCT_TM AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 594c89940df..a83452b9145 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -820,23 +820,9 @@ extern int cpp_defined (cpp_reader *, const unsigned char *, int); /* A preprocessing number. Code assumes that any unused high bits of the double integer are set to zero. */ -/* Find a type with at least 64bit precision, mimicking hwint.h. - This type has to be equal to unsigned HOST_WIDE_INT, see +/* This type has to be equal to unsigned HOST_WIDE_INT, see gcc/c-family/c-lex.c. */ -#if SIZEOF_LONG >= 8 -typedef unsigned long cpp_num_part; -#else -# if SIZEOF_LONG_LONG >= 8 -typedef unsigned long long cpp_num_part; -# else -# if SIZEOF___INT64 >= 8 -typedef unsigned __int64 cpp_num_part; -# else - #error "This line should be impossible to reach" -# endif -# endif -#endif - +typedef uint64_t cpp_num_part; typedef struct cpp_num cpp_num; struct cpp_num { |