summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorTom Lane2017-09-01 19:14:18 +0000
committerTom Lane2017-09-01 19:14:46 +0000
commit9d6b160d7db76809f0c696d9073f6955dd5a973a (patch)
tree5ec2c6e5dd26c060419322f18e1874a240e888cc /configure
parenta0572203532560423c92066b90d13383720dce3a (diff)
Make [U]INT64CONST safe for use in #if conditions.
Instead of using a cast to force the constant to be the right width, assume we can plaster on an L, UL, LL, or ULL suffix as appropriate. The old approach to this is very hoary, dating from before we were willing to require compilers to have working int64 types. This fix makes the PG_INT64_MIN, PG_INT64_MAX, and PG_UINT64_MAX constants safe to use in preprocessor conditions, where a cast doesn't work. Other symbolic constants that might be defined using [U]INT64CONST are likewise safer than before. Also fix the SIZE_MAX macro to be similarly safe, if we are forced to provide a definition for that. The test added in commit 2e70d6b5e happens to do what we want even with the hack "(size_t) -1" definition, but we could easily get burnt on other tests in future. Back-patch to all supported branches, like the previous commits. Discussion: https://postgr.es/m/15883.1504278595@sss.pgh.pa.us
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure18
1 files changed, 0 insertions, 18 deletions
diff --git a/configure b/configure
index a2f9a256b4..0d76e5ea42 100755
--- a/configure
+++ b/configure
@@ -14254,24 +14254,6 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-
-if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#define INT64CONST(x) x##LL
-long long int foo = INT64CONST(0x1234567890123456);
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-$as_echo "#define HAVE_LL_CONSTANTS 1" >>confdefs.h
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-
# If we found "long int" is 64 bits, assume snprintf handles it. If
# we found we need to use "long long int", better check. We cope with
# snprintfs that use %lld, %qd, or %I64d as the format. If none of these