]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/39065 (libiberty hashtab.c:hash_pointer() needs intptr_t)
authorOzkan Sezer <sezeroz@gmail.com>
Fri, 4 Sep 2009 14:33:16 +0000 (14:33 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Fri, 4 Sep 2009 14:33:16 +0000 (07:33 -0700)
2009-09-04  Ozkan Sezer  <sezeroz@gmail.com>

PR target/39065
* configure.ac: Replace AC_CHECK_TYPE() for intptr_t and uintptr_t
with AC_TYPE_INTPTR_T and AC_TYPE_UINTPTR_T.
* config.in: Regenerated.
* configure: Regenerated.

From-SVN: r151423

libiberty/ChangeLog
libiberty/config.in
libiberty/configure
libiberty/configure.ac

index 17fb033c6f99ca52125a5c0e2d491acd94ad9c35..b3dc41708b4a54459c5bea48547658fa0ce88c27 100644 (file)
@@ -1,3 +1,11 @@
+2009-09-04  Ozkan Sezer  <sezeroz@gmail.com>
+
+       PR target/39065
+       * configure.ac: Replace AC_CHECK_TYPE() for intptr_t and uintptr_t
+       with AC_TYPE_INTPTR_T and AC_TYPE_UINTPTR_T.
+       * config.in: Regenerated.
+       * configure: Regenerated.
+
 2009-09-03  Ozkan Sezer  <sezeroz@gmail.com>
 
        PR target/39065
index e962769e6a950922fb8a9496c105b4aaae3d7d07..193164830cf82822c98c7033b335a386ef194d46 100644 (file)
 /* Define to 1 if you have the `insque' function. */
 #undef HAVE_INSQUE
 
+/* Define to 1 if the system has the type `intptr_t'. */
+#undef HAVE_INTPTR_T
+
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
 #undef inline
 #endif
 
-/* Define to `long' if <sys/types.h> does not define. */
+/* Define to the type of a signed integer type wide enough to hold a pointer,
+   if such a type exists, and if the system does not define it. */
 #undef intptr_t
 
 /* Define to `int' if <sys/types.h> does not define. */
 #undef pid_t
 
-/* Define to `unsigned long' if <sys/types.h> does not define. */
+/* 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
 
 /* Define as `fork' if `vfork' does not work. */
index 9463f8f506f54aa1a66977ff2f25f08eb724e6bc..423e59b9b30a690c54a672ebc42de94400a48177 100755 (executable)
@@ -5046,29 +5046,6 @@ _ACEOF
 
 
 
-ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
-if test "x$ac_cv_type_intptr_t" = x""yes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define intptr_t long
-_ACEOF
-
-fi
-
-ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
-if test "x$ac_cv_type_uintptr_t" = x""yes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define uintptr_t unsigned long
-_ACEOF
-
-fi
-
-
 # Look for a 64-bit type.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a 64-bit type" >&5
 $as_echo_n "checking for a 64-bit type... " >&6; }
@@ -5148,6 +5125,78 @@ _ACEOF
 
 fi
 
+
+  ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_intptr_t" = x""yes; then :
+
+$as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h
+
+else
+  for ac_type in 'int' 'long int' 'long long int'; do
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define intptr_t $ac_type
+_ACEOF
+
+         ac_type=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       test -z "$ac_type" && break
+     done
+fi
+
+
+
+  ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default"
+if test "x$ac_cv_type_uintptr_t" = x""yes; then :
+
+$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h
+
+else
+  for ac_type in 'unsigned int' 'unsigned long int' \
+       'unsigned long long int'; do
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define uintptr_t $ac_type
+_ACEOF
+
+         ac_type=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       test -z "$ac_type" && break
+     done
+fi
+
+
+
 # Given the above check, we always have uintptr_t or a fallback
 # definition.  So define HAVE_UINTPTR_T in case any imported code
 # relies on it.
index c34fc10b81bf5b2959701fc3d2e7545fa28c7ad7..00dd68dcef2c35c6858281f40ea7c80c2cabccf7 100644 (file)
@@ -254,9 +254,6 @@ libiberty_AC_DECLARE_ERRNO
 # Determine the size of an int for struct fibnode.
 AC_CHECK_SIZEOF([int])
 
-AC_CHECK_TYPE(intptr_t, long)
-AC_CHECK_TYPE(uintptr_t, unsigned long)
-
 # Look for a 64-bit type.
 AC_MSG_CHECKING([for a 64-bit type])
 AC_CACHE_VAL(liberty_cv_uint64,
@@ -290,6 +287,9 @@ if test "$liberty_cv_uint64" != none; then
                      [Define to an unsigned 64-bit type available in the compiler.])
 fi
 
+AC_TYPE_INTPTR_T
+AC_TYPE_UINTPTR_T
+
 # Given the above check, we always have uintptr_t or a fallback
 # definition.  So define HAVE_UINTPTR_T in case any imported code
 # relies on it.