From: Eric Branlund Date: Sat, 4 Apr 2020 17:32:11 +0000 (-0700) Subject: Bring over habu's 2012 November 18 change, autoconfから--enable-c99を削除し、stdint.hの有無で判定す... X-Git-Tag: version-1-6-2a~33 X-Git-Url: http://git.osdn.net/view?p=hengbandforosx%2Fhengbandosx.git;a=commitdiff_plain;h=6e4bd501d882d518a24a7f655bf1281c451cfa8c Bring over habu's 2012 November 18 change, autoconfから--enable-c99を削除し、stdint.hの有無で判定するよう変更 , to use stdint.h as the basis for configuring fixed-size integer types. Avoids a problem with the initialization of the random number generator when compiling on Mac OS X. --- diff --git a/configure.ac b/configure.ac index a393165f7..e3c1b8507 100644 --- a/configure.ac +++ b/configure.ac @@ -100,7 +100,7 @@ if test "$have_x" = yes; then fi AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h strings.h sys/file.h sys/ioctl.h sys/time.h termio.h unistd.h) +AC_CHECK_HEADERS(fcntl.h strings.h sys/file.h sys/ioctl.h sys/time.h termio.h unistd.h stdint.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST diff --git a/src/h-type.h b/src/h-type.h index 9f291de8d..5dda35788 100644 --- a/src/h-type.h +++ b/src/h-type.h @@ -38,7 +38,9 @@ * These limits should be verified and coded into "h-constant.h". */ - +#ifdef HAVE_STDINT_H +#include +#endif /*** Special 4 letter names for some standard types ***/ @@ -113,13 +115,18 @@ typedef unsigned long huge; /* Signed/Unsigned 16 bit value */ +#ifdef HAVE_STDINT_H +typedef int16_t s16b; +typedef uint16_t u16b; +#else typedef signed short s16b; typedef unsigned short u16b; +#endif /* Signed/Unsigned 32 bit value */ -#ifdef L64 /* 64 bit longs */ -typedef signed int s32b; -typedef unsigned int u32b; +#ifdef HAVE_STDINT_H +typedef int32_t s32b; +typedef uint32_t u32b; #else typedef signed long s32b; typedef unsigned long u32b;