summaryrefslogtreecommitdiff
path: root/src/include/c.h
diff options
context:
space:
mode:
authorPeter Eisentraut2020-02-21 08:14:03 +0000
committerPeter Eisentraut2020-02-21 08:20:32 +0000
commit957338418b69e9774ccc1bab59f765a62f0aa6f9 (patch)
treec4e018e687ecb115bb235f87f8d3c60bcd12331f /src/include/c.h
parentdca3911a81f0ba823b56c3d4462419c83f385e55 (diff)
Require stdint.h
stdint.h belongs to the compiler (as opposed to inttypes.h), so by requiring a C99 compiler we can also require stdint.h unconditionally. Remove configure checks and other workarounds for it. This also removes a few steps in the required portability adjustments to the imported time zone code, which can be applied on the next import. When using GCC on a platform that is otherwise pre-C99, this will now require at least GCC 4.5, which is the first release that supplied a standard-conforming stdint.h if the native platform didn't have it. Reviewed-by: Tom Lane <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/5d398bbb-262a-5fed-d839-d0e5cff3c0d7%402ndquadrant.com
Diffstat (limited to 'src/include/c.h')
-rw-r--r--src/include/c.h15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/include/c.h b/src/include/c.h
index d10b9812fbe..2e8b2d4e3fe 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -64,9 +64,7 @@
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
-#ifdef HAVE_STDINT_H
#include <stdint.h>
-#endif
#include <sys/types.h>
#include <errno.h>
#if defined(WIN32) || defined(__CYGWIN__)
@@ -429,8 +427,8 @@ typedef unsigned PG_INT128_TYPE uint128
#endif
/*
- * stdint.h limits aren't guaranteed to be present and aren't guaranteed to
- * have compatible types with our fixed width types. So just define our own.
+ * stdint.h limits aren't guaranteed to have compatible types with our fixed
+ * width types. So just define our own.
*/
#define PG_INT8_MIN (-0x7F-1)
#define PG_INT8_MAX (0x7F)
@@ -445,15 +443,6 @@ typedef unsigned PG_INT128_TYPE uint128
#define PG_INT64_MAX INT64CONST(0x7FFFFFFFFFFFFFFF)
#define PG_UINT64_MAX UINT64CONST(0xFFFFFFFFFFFFFFFF)
-/* Max value of size_t might also be missing if we don't have stdint.h */
-#ifndef SIZE_MAX
-#if SIZEOF_SIZE_T == 8
-#define SIZE_MAX PG_UINT64_MAX
-#else
-#define SIZE_MAX PG_UINT32_MAX
-#endif
-#endif
-
/*
* We now always use int64 timestamps, but keep this symbol defined for the
* benefit of external code that might test it.