OSDN Git Service

Bring over habu's 2012 November 18 change, autoconfから--enable-c99を削除し、stdint.hの有無で判定す...
authorEric Branlund <ebranlund@fastmail.com>
Sat, 4 Apr 2020 17:32:11 +0000 (10:32 -0700)
committerEric Branlund <ebranlund@fastmail.com>
Sat, 4 Apr 2020 17:32:11 +0000 (10:32 -0700)
configure.ac
src/h-type.h

index a393165..e3c1b85 100644 (file)
@@ -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
index 9f291de..5dda357 100644 (file)
@@ -38,7 +38,9 @@
  * These limits should be verified and coded into "h-constant.h".
  */
 
-
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#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;