aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2001-12-02 11:38:40 +0000
committerPeter Eisentraut <peter_e@gmx.net>2001-12-02 11:38:40 +0000
commit15abc7788e66ab4b456dabdc8ebb0565113b1b32 (patch)
tree727fee4b96031c96c2fcae4060a85c912d3c01f4 /src
parentad81c999846e2360a5bf55c6e4d49696b72009b6 (diff)
downloadpostgresql-15abc7788e66ab4b456dabdc8ebb0565113b1b32.tar.gz
postgresql-15abc7788e66ab4b456dabdc8ebb0565113b1b32.zip
More correct way to check for existence of types, which allows to specify
which include files to consider. Should fix BeOS problems with int8 types.
Diffstat (limited to 'src')
-rw-r--r--src/include/c.h34
-rw-r--r--src/include/pg_config.h.in10
-rw-r--r--src/interfaces/odbc/md5.h4
3 files changed, 25 insertions, 23 deletions
diff --git a/src/include/c.h b/src/include/c.h
index 65fde5a4d61..201552d72b7 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: c.h,v 1.111 2001/11/15 16:35:19 momjian Exp $
+ * $Id: c.h,v 1.112 2001/12/02 11:38:40 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -205,11 +205,11 @@ typedef char *Pointer;
* used for numerical computations and the
* frontend/backend protocol.
*/
-#if SIZEOF_INT8 == 0
+#ifndef HAVE_INT8
typedef signed char int8; /* == 8 bits */
typedef signed short int16; /* == 16 bits */
typedef signed int int32; /* == 32 bits */
-#endif /* SIZEOF_INT8 == 0 */
+#endif /* not HAVE_INT8 */
/*
* uintN
@@ -218,11 +218,11 @@ typedef signed int int32; /* == 32 bits */
* frontend/backend protocol.
*/
/* Also defined in interfaces/odbc/md5.h */
-#if SIZEOF_UINT8 == 0
+#ifndef HAVE_UINT8
typedef unsigned char uint8; /* == 8 bits */
typedef unsigned short uint16; /* == 16 bits */
typedef unsigned int uint32; /* == 32 bits */
-#endif /* SIZEOF_UINT8 == 0 */
+#endif /* not HAVE_UINT8 */
/*
* boolN
@@ -270,35 +270,37 @@ typedef double *float64;
*/
#ifdef HAVE_LONG_INT_64
/* Plain "long int" fits, use it */
-#if SIZEOF_INT64 == 0
+
+#ifndef HAVE_INT64
typedef long int int64;
#endif
-#if SIZEOF_UINT64 == 0
+#ifndef HAVE_UINT64
typedef unsigned long int uint64;
#endif
-#else
-#ifdef HAVE_LONG_LONG_INT_64
+#elif defined(HAVE_LONG_LONG_INT_64)
/* We have working support for "long long int", use that */
-#if SIZEOF_INT64 == 0
+
+#ifndef HAVE_INT64
typedef long long int int64;
#endif
-#if SIZEOF_UINT64 == 0
+#ifndef HAVE_UINT64
typedef unsigned long long int uint64;
#endif
-#else
+#else /* not HAVE_LONG_INT_64 and not HAVE_LONG_LONG_INT_64 */
+
/* Won't actually work, but fall back to long int so that code compiles */
-#if SIZEOF_INT64 == 0
+#ifndef HAVE_INT64
typedef long int int64;
#endif
-#if SIZEOF_UINT64 == 0
+#ifndef HAVE_UINT64
typedef unsigned long int uint64;
#endif
#define INT64_IS_BUSTED
-#endif
-#endif
+
+#endif /* not HAVE_LONG_INT_64 and not HAVE_LONG_LONG_INT_64 */
/*
* Size
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index c513f4fc5be..19766b81830 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -8,7 +8,7 @@
* or in pg_config.h afterwards. Of course, if you edit pg_config.h, then your
* changes will be overwritten the next time you run configure.
*
- * $Id: pg_config.h.in,v 1.13 2001/11/15 16:35:19 momjian Exp $
+ * $Id: pg_config.h.in,v 1.14 2001/12/02 11:38:40 petere Exp $
*/
#ifndef PG_CONFIG_H
@@ -697,10 +697,10 @@ extern int fdatasync(int fildes);
/* Define if you have on_exit() */
#undef HAVE_ON_EXIT
-#undef SIZEOF_INT8
-#undef SIZEOF_UINT8
-#undef SIZEOF_INT64
-#undef SIZEOF_UINT64
+#undef HAVE_INT8
+#undef HAVE_UINT8
+#undef HAVE_INT64
+#undef HAVE_UINT64
/*
*------------------------------------------------------------------------
diff --git a/src/interfaces/odbc/md5.h b/src/interfaces/odbc/md5.h
index 3daaf16c3fb..2e2429d33d0 100644
--- a/src/interfaces/odbc/md5.h
+++ b/src/interfaces/odbc/md5.h
@@ -36,11 +36,11 @@ typedef char bool;
#endif /* __BEOS__ */
/* Also defined in include/c.h */
-#if SIZEOF_UINT8 == 0
+#ifndef HAVE_UINT8
typedef unsigned char uint8; /* == 8 bits */
typedef unsigned short uint16; /* == 16 bits */
typedef unsigned int uint32; /* == 32 bits */
-#endif /* SIZEOF_UINT8 == 0 */
+#endif /* not HAVE_UINT8 */
extern bool md5_hash(const void *buff, size_t len, char *hexsum);
extern bool EncryptMD5(const char *passwd, const char *salt,