Commit 9bf3c9cc by Richard Henderson Committed by Richard Henderson

hashtab.c: Include limits.h, stdint.h, ansidecl.h.

        * hashtab.c: Include limits.h, stdint.h, ansidecl.h.
        (CHAR_BIT): Provide default.
        (struct prime_ent, prime_tab): New.
        (higher_prime_index): Rename from higher_prime_number, return index.
        (htab_mod_1): New.
        (htab_mod, htab_mod_m2): Use it.
        (htab_create_alloc, htab_create_alloc_ex): Store prime index.
        (htab_expand): Likewise.
        * configure.ac: Check for stdint.h.
        (UNSIGNED_64BIT_TYPE): New define and checks to fill it in.
        * config.in, configure: Rebuild.

From-SVN: r81029
parent a95cd5a0
2004-04-22 Richard Henderson <rth@redhat.com>
* hashtab.c: Include limits.h, stdint.h, ansidecl.h.
(CHAR_BIT): Provide default.
(struct prime_ent, prime_tab): New.
(higher_prime_index): Rename from higher_prime_number, return index.
(htab_mod_1): New.
(htab_mod, htab_mod_m2): Use it.
(htab_create_alloc, htab_create_alloc_ex): Store prime index.
(htab_expand): Likewise.
* configure.ac: Check for stdint.h.
(UNSIGNED_64BIT_TYPE): New define and checks to fill it in.
* config.in, configure: Rebuild.
2004-04-13 Ian Lance Taylor <ian@wasabisystems.com> 2004-04-13 Ian Lance Taylor <ian@wasabisystems.com>
* strerror.c: Include config.h, and redefine sys_nerr and * strerror.c: Include config.h, and redefine sys_nerr and
......
...@@ -353,6 +353,9 @@ ...@@ -353,6 +353,9 @@
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME #undef TIME_WITH_SYS_TIME
/* Define to an unsigned 64-bit type available in the compiler. */
#undef UNSIGNED_64BIT_TYPE
/* whether byteorder is bigendian */ /* whether byteorder is bigendian */
#undef WORDS_BIGENDIAN #undef WORDS_BIGENDIAN
......
...@@ -159,13 +159,47 @@ AC_SUBST_FILE(host_makefile_frag) ...@@ -159,13 +159,47 @@ AC_SUBST_FILE(host_makefile_frag)
# It's OK to check for header files. Although the compiler may not be # It's OK to check for header files. Although the compiler may not be
# able to link anything, it had better be able to at least compile # able to link anything, it had better be able to at least compile
# something. # something.
AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h) AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h stdint.h)
AC_HEADER_SYS_WAIT AC_HEADER_SYS_WAIT
AC_HEADER_TIME AC_HEADER_TIME
libiberty_AC_DECLARE_ERRNO libiberty_AC_DECLARE_ERRNO
AC_CHECK_TYPE(uintptr_t, unsigned 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,
[AC_TRY_COMPILE(
[#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif],
[extern uint64_t foo;],
liberty_cv_uint64=uint64_t,
[AC_TRY_COMPILE(
[#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifndef CHAR_BIT
#define CHAR_BIT 8
#endif],
[extern char foo[sizeof(long) * CHAR_BIT >= 64 ? 1 : -1];],
liberty_cv_uint64="unsigned long",
[AC_TRY_COMPILE(
[#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifndef CHAR_BIT
#define CHAR_BIT 8
#endif],
[extern char foo[sizeof(long long) * CHAR_BIT >= 64 ? 1 : -1];],
liberty_cv_uint64="unsigned long long", liberty_cv_uint64=none)])])])
AC_MSG_RESULT($liberty_cv_uint64)
if test "$liberty_cv_uint64" != none; then
AC_DEFINE(UNSIGNED_64BIT_TYPE, $liberty_cv_uint64,
[Define to an unsigned 64-bit type available in the compiler.])
fi
# Given the above check, we always have uintptr_t or a fallback # Given the above check, we always have uintptr_t or a fallback
# definition. So define HAVE_UINTPTR_T in case any imported code # definition. So define HAVE_UINTPTR_T in case any imported code
# relies on it. # relies on it.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment