summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorTom Lane2012-10-08 01:52:07 +0000
committerTom Lane2012-10-08 01:52:43 +0000
commit95d035e66d8e4371d35830d81f39face03cd4c45 (patch)
tree450c4e30491bd17f6499e8a33c094f9353238f79 /configure.in
parentea72bb8ae527d371ccaf53647540a33224df92a6 (diff)
Autoconfiscate selection of 64-bit int type for 64-bit large object API.
Get rid of the fundamentally indefensible assumption that "long long int" exists and is exactly 64 bits wide on every platform Postgres runs on. Instead let the configure script select the type to use for "pg_int64". This is a bit of a pain in the rear since we do not want to pollute client namespace with all the random symbols that pg_config.h defines; instead we have to create a separate generated header file, "pg_config_ext.h". But now that the infrastructure is there, we might have the ability to add some other stuff that's long been wanting in this area.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in16
1 files changed, 14 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index fef8e7f013..2dee4b392b 100644
--- a/configure.in
+++ b/configure.in
@@ -1580,13 +1580,19 @@ dnl 64-bit type. But we still handle the case of snprintf being broken.
PGAC_TYPE_64BIT_INT([long int])
-if test x"$HAVE_LONG_INT_64" = x"no" ; then
+if test x"$HAVE_LONG_INT_64" = x"yes" ; then
+ pg_int64_type="long int"
+else
PGAC_TYPE_64BIT_INT([long long int])
- if test x"$HAVE_LONG_LONG_INT_64" = x"no" ; then
+ if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then
+ pg_int64_type="long long int"
+ else
AC_MSG_ERROR([Cannot find a working 64-bit integer type.])
fi
fi
+AC_DEFINE_UNQUOTED(PG_INT64_TYPE, $pg_int64_type,
+ [Define to the name of a signed 64-bit integer type.])
dnl If we need to use "long long int", figure out whether nnnLL notation works.
@@ -1935,6 +1941,12 @@ AC_CONFIG_HEADERS([src/include/pg_config.h],
echo >src/include/stamp-h
])
+AC_CONFIG_HEADERS([src/include/pg_config_ext.h],
+[
+# Update timestamp for pg_config_ext.h (see Makefile.global)
+echo >src/include/stamp-ext-h
+])
+
AC_CONFIG_HEADERS([src/interfaces/ecpg/include/ecpg_config.h],
[echo >src/interfaces/ecpg/include/stamp-h])