aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/c.h19
-rw-r--r--src/include/pg_config.h.in4
-rw-r--r--src/include/pg_config.h.win328
3 files changed, 10 insertions, 21 deletions
diff --git a/src/include/c.h b/src/include/c.h
index fad895204b7..0976ddffd87 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -265,6 +265,8 @@ typedef long int int64;
#ifndef HAVE_UINT64
typedef unsigned long int uint64;
#endif
+#define INT64CONST(x) (x##L)
+#define UINT64CONST(x) (x##UL)
#elif defined(HAVE_LONG_LONG_INT_64)
/* We have working support for "long long int", use that */
@@ -274,23 +276,20 @@ typedef long long int int64;
#ifndef HAVE_UINT64
typedef unsigned long long int uint64;
#endif
+#define INT64CONST(x) (x##LL)
+#define UINT64CONST(x) (x##ULL)
#else
/* neither HAVE_LONG_INT_64 nor HAVE_LONG_LONG_INT_64 */
#error must have a working 64-bit integer datatype
#endif
-/* Decide if we need to decorate 64-bit constants */
-#ifdef HAVE_LL_CONSTANTS
-#define INT64CONST(x) ((int64) x##LL)
-#define UINT64CONST(x) ((uint64) x##ULL)
-#else
-#define INT64CONST(x) ((int64) x)
-#define UINT64CONST(x) ((uint64) x)
-#endif
-
/* Max value of size_t might be missing if we don't have stdint.h */
#ifndef SIZE_MAX
-#define SIZE_MAX ((size_t) -1)
+#if SIZEOF_SIZE_T == 8
+#define SIZE_MAX UINT64CONST(0xFFFFFFFFFFFFFFFF)
+#else
+#define SIZE_MAX (0xFFFFFFFFU)
+#endif
#endif
/* Select timestamp representation (float8 or int64) */
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 0f69b3d5217..650f2dceb74 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -311,10 +311,6 @@
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
-/* Define to 1 if constants of type 'long long int' should have the suffix LL.
- */
-#undef HAVE_LL_CONSTANTS
-
/* Define to 1 if the system has the type `locale_t'. */
#undef HAVE_LOCALE_T
diff --git a/src/include/pg_config.h.win32 b/src/include/pg_config.h.win32
index d68fed22f7b..60f91056af7 100644
--- a/src/include/pg_config.h.win32
+++ b/src/include/pg_config.h.win32
@@ -220,12 +220,6 @@
/* Define to 1 if you have the `z' library (-lz). */
/* #undef HAVE_LIBZ */
-/* Define to 1 if constants of type 'long long int' should have the suffix LL.
- */
-#if (_MSC_VER > 1200)
-#define HAVE_LL_CONSTANTS 1
-#endif
-
/* Define to 1 if the system has the type `locale_t'. */
#define HAVE_LOCALE_T 1
@@ -234,7 +228,7 @@
/* Define to 1 if `long long int' works and is 64 bits. */
#if (_MSC_VER > 1200)
-#define HAVE_LONG_LONG_INT_64
+#define HAVE_LONG_LONG_INT_64 1
#endif
/* Define to 1 if you have the `mbstowcs_l' function. */