summaryrefslogtreecommitdiff
path: root/src/include/pg_config_manual.h
diff options
context:
space:
mode:
authorAndres Freund2015-04-02 15:43:35 +0000
committerAndres Freund2015-04-02 15:43:35 +0000
commit62e2a8dc2c7f6b1351a0385491933af969ed4265 (patch)
tree3fd46136353e1838f871478232935dbba0866392 /src/include/pg_config_manual.h
parente146ca682062ca1f5015f3820571c5359f5f9dba (diff)
Define integer limits independently from the system definitions.
In 83ff1618 we defined integer limits iff they're not provided by the system. That turns out not to be the greatest idea because there's different ways some datatypes can be represented. E.g. on OSX PG's 64bit datatype will be a 'long int', but OSX unconditionally uses 'long long'. That disparity then can lead to warnings, e.g. around printf formats. One way to fix that would be to back int64 using stdint.h's int64_t. While a good idea it's not that easy to implement. We would e.g. need to include stdint.h in our external headers, which we don't today. Also computing the correct int64 printf formats in that case is nontrivial. Instead simply prefix the integer limits with PG_ and define them unconditionally. I've adjusted all the references to them in code, but not the ones in comments; the latter seems unnecessary to me. Discussion: [email protected]
Diffstat (limited to 'src/include/pg_config_manual.h')
-rw-r--r--src/include/pg_config_manual.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h
index d3e9888b7b9..e278fa07d3d 100644
--- a/src/include/pg_config_manual.h
+++ b/src/include/pg_config_manual.h
@@ -48,7 +48,7 @@
/*
* Set the upper and lower bounds of sequence values.
*/
-#define SEQ_MAXVALUE INT64_MAX
+#define SEQ_MAXVALUE PG_INT64_MAX
#define SEQ_MINVALUE (-SEQ_MAXVALUE)
/*
@@ -185,7 +185,7 @@
* the older rand() function, which is often different from --- and
* considerably inferior to --- random().
*/
-#define MAX_RANDOM_VALUE INT32_MAX
+#define MAX_RANDOM_VALUE PG_INT32_MAX
/*
* On PPC machines, decide whether to use the mutex hint bit in LWARX