git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: feed7cf)
Add configure support for determining UINT64_FORMAT, the appropriate
2004年2月10日 19:55:45 +0000 (19:55 +0000)
2004年2月10日 19:55:45 +0000 (19:55 +0000)
snprintf format for uint64 items.


diff --git a/configure b/configure
index 43d4fc4e8f5adab4acd55302e0cef3c9094fe359..88f763e8318cf8f61df76fea108c2331970489a3 100755 (executable)
--- a/configure
+++ b/configure
@@ -13659,9 +13659,8 @@ 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 either %lld, %qd, or %I64d as the format. If
-# neither works, fall back to our own snprintf emulation (which we
-# know uses %lld).
+# snprintfs that use %lld, %qd, or %I64d as the format. If none of these
+# work, fall back to our own snprintf emulation (which we know uses %lld).
if test "$HAVE_LONG_LONG_INT_64" = yes ; then
if test $pgac_need_repl_snprintf = no; then
@@ -13744,10 +13743,13 @@ esac
# Here if we previously decided we needed to use our own snprintf
LONG_LONG_INT_FORMAT='%lld'
fi
+ LONG_LONG_UINT_FORMAT=`echo "$LONG_LONG_INT_FORMAT" | sed 's/d$/u/'`
INT64_FORMAT="\"$LONG_LONG_INT_FORMAT\""
+ UINT64_FORMAT="\"$LONG_LONG_UINT_FORMAT\""
else
# Here if we are not using 'long long int' at all
INT64_FORMAT='"%ld"'
+ UINT64_FORMAT='"%lu"'
fi
@@ -13756,6 +13758,12 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define UINT64_FORMAT $UINT64_FORMAT
+_ACEOF
+
+
if test $pgac_need_repl_snprintf = yes; then
LIBOBJS="$LIBOBJS snprintf.$ac_objext"
fi
diff --git a/configure.in b/configure.in
index 6f90cbfa5ad23f6b6a53a907cfd11fa17ed5e7b8..3f7994fbbf4b32b6da079ee219b3147b9e7c6612 100644 (file)
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.313 2004年02月02日 22:20:32 momjian Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.314 2004年02月10日 19:55:45 tgl Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
@@ -1063,9 +1063,8 @@ 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 either %lld, %qd, or %I64d as the format. If
-# neither works, fall back to our own snprintf emulation (which we
-# know uses %lld).
+# snprintfs that use %lld, %qd, or %I64d as the format. If none of these
+# work, fall back to our own snprintf emulation (which we know uses %lld).
if test "$HAVE_LONG_LONG_INT_64" = yes ; then
if test $pgac_need_repl_snprintf = no; then
@@ -1079,15 +1078,21 @@ if test "$HAVE_LONG_LONG_INT_64" = yes ; then
# Here if we previously decided we needed to use our own snprintf
LONG_LONG_INT_FORMAT='%lld'
fi
+ LONG_LONG_UINT_FORMAT=`echo "$LONG_LONG_INT_FORMAT" | sed 's/d$/u/'`
INT64_FORMAT="\"$LONG_LONG_INT_FORMAT\""
+ UINT64_FORMAT="\"$LONG_LONG_UINT_FORMAT\""
else
# Here if we are not using 'long long int' at all
INT64_FORMAT='"%ld"'
+ UINT64_FORMAT='"%lu"'
fi
AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT,
[Define to the appropriate snprintf format for 64-bit ints, if any.])
+AC_DEFINE_UNQUOTED(UINT64_FORMAT, $UINT64_FORMAT,
+ [Define to the appropriate snprintf format for unsigned 64-bit ints, if any.])
+
if test $pgac_need_repl_snprintf = yes; then
AC_LIBOBJ(snprintf)
fi
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index b53fed22572ed85e0490530b6bd650c0457ad0e2..3b3cc095410f0b9cb35933cbb77f17d32a098e78 100644 (file)
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -588,6 +588,10 @@
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
+/* Define to the appropriate snprintf format for unsigned 64-bit ints, if any.
+ */
+#undef UINT64_FORMAT
+
/* Define to 1 to build with assertion checks. (--enable-cassert) */
#undef USE_ASSERT_CHECKING
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /