Fix for AIX compile and unsigned/signed typedefs.
authorBruce Momjian <[email protected]>
Thu, 15 Nov 2001 16:09:34 +0000 (16:09 +0000)
committerBruce Momjian <[email protected]>
Thu, 15 Nov 2001 16:09:34 +0000 (16:09 +0000)
Peter E, Tatsuo, Andreas

configure.in
src/include/c.h
src/include/pg_config.h.in

index cd3bac3cfaaa6f692f199f27987444003f0695b8..c223ce51b65dbca2bb00d929ac97675d8a599778 100644 (file)
@@ -1169,6 +1169,12 @@ else
 fi
 AC_DEFINE_UNQUOTED(MAXIMUM_ALIGNOF, $MAX_ALIGNOF, [Define as the maximum alignment requirement of any type])
 
+# Some platforms predefine the types int8, int16, etc.  Only check
+# a (hopefully) representative subset.  Don't use AC_CHECK_TYPE, which
+# doesn't work the way we want to.
+AC_CHECK_SIZEOF(int8, 0)
+AC_CHECK_SIZEOF(uint8, 0)
+
 PGAC_FUNC_POSIX_SIGNALS
 
 
index 2489437d455295e29483ab2ac1793098f3ac6f28..b42811baeb5f1bf5a4e43551b91cbcf137fe002d 100644 (file)
@@ -205,11 +205,11 @@ typedef char *Pointer;
  *             used for numerical computations and the
  *             frontend/backend protocol.
  */
-#ifndef __BEOS__                               /* this shouldn't be required, but is is! */
+#if SIZEOF_INT8 == 0
 typedef signed char int8;              /* == 8 bits */
 typedef signed short int16;            /* == 16 bits */
 typedef signed int int32;              /* == 32 bits */
-#endif   /* __BEOS__ */
+#endif   /* SIZEOF_INT8 == 0 */
 
 /*
  * uintN
@@ -218,11 +218,11 @@ typedef signed int int32;         /* == 32 bits */
  *             frontend/backend protocol.
  */
 /* Also defined in interfaces/odbc/md5.h */
-#ifndef __BEOS__                               /* this shouldn't be required, but is is! */
+#if SIZEOF_UINT8 == 0
 typedef unsigned char uint8;   /* == 8 bits */
 typedef unsigned short uint16; /* == 16 bits */
 typedef unsigned int uint32;   /* == 32 bits */
-#endif   /* __BEOS__ */
+#endif   /* SIZEOF_UINT8 == 0 */
 
 /*
  * boolN
@@ -268,27 +268,37 @@ typedef double *float64;
 /*
  * 64-bit integers
  */
-#ifndef __BEOS__                               /* this is already defined on BeOS */
 #ifdef HAVE_LONG_INT_64
 /* Plain "long int" fits, use it */
+#if SIZEOF_INT8 == 0
 typedef long int int64;
+#endif
+#if SIZEOF_UINT8 == 0
 typedef unsigned long int uint64;
+#endif
 
 #else
 #ifdef HAVE_LONG_LONG_INT_64
 /* We have working support for "long long int", use that */
+#if SIZEOF_INT8 == 0
 typedef long long int int64;
+#endif
+#if SIZEOF_UINT8 == 0
 typedef unsigned long long int uint64;
+#endif
 
 #else
 /* Won't actually work, but fall back to long int so that code compiles */
+#if SIZEOF_INT8 == 0
 typedef long int int64;
+#endif
+#if SIZEOF_UINT8 == 0
 typedef unsigned long int uint64;
+#endif
 
 #define INT64_IS_BUSTED
 #endif
 #endif
-#endif   /* __BEOS__ */
 
 /*
  * Size
index 8bb91a99bba85f05100e4b3a925f390034477948..76ee175298d2e678ef4d5241f111425aa6724cb0 100644 (file)
@@ -697,6 +697,9 @@ extern int fdatasync(int fildes);
 /* Define if you have on_exit() */
 #undef HAVE_ON_EXIT
 
+#undef SIZEOF_INT8
+#undef SIZEOF_UINT8
+
 /*
  *------------------------------------------------------------------------
  * Part 4: pull in system-specific declarations.