Move configure --disable-float8-byval to pg_config_manual.h
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 27 Nov 2019 10:21:02 +0000 (11:21 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 27 Nov 2019 11:27:20 +0000 (12:27 +0100)
This build option was once useful to maintain compatibility with
version-0 functions, but those are no longer supported, so this option
is no longer useful for end users.  We keep the option available to
developers in pg_config_manual.h so that it is easy to test the
pass-by-reference code paths without having to fire up a 32-bit
machine.

Discussion: https://www.postgresql.org/message-id/flat/f3e1e576-2749-bbd7-2d57-3f9dcf75255a@2ndquadrant.com

configure
configure.in
doc/src/sgml/installation.sgml
src/include/c.h
src/include/pg_config.h.in
src/include/pg_config_manual.h
src/tools/msvc/Solution.pm
src/tools/msvc/config_default.pl

index b06a95dabcae7ed3f45bef993a7773084d0ab000..1d88983b34dfaf2b1629077bd3ca7e3112dc2b74 100755 (executable)
--- a/configure
+++ b/configure
@@ -866,7 +866,6 @@ with_system_tzdata
 with_zlib
 with_gnu_ld
 enable_largefile
-enable_float8_byval
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1524,7 +1523,6 @@ Optional Features:
   --enable-cassert        enable assertion checks (for debugging)
   --disable-thread-safety disable thread-safety in client libraries
   --disable-largefile     omit support for large files
-  --disable-float8-byval  disable float8 passed by value
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -16745,80 +16743,6 @@ _ACEOF
 
 
 
-# Decide whether float8 is passed by value.
-# Note: this setting also controls int8 and related types such as timestamp.
-# If sizeof(Datum) >= 8, this is user-selectable, enabled by default.
-# If not, trying to select it is an error.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with float8 passed by value" >&5
-$as_echo_n "checking whether to build with float8 passed by value... " >&6; }
-if test $ac_cv_sizeof_void_p -ge 8 ; then
-
-
-# Check whether --enable-float8-byval was given.
-if test "${enable_float8_byval+set}" = set; then :
-  enableval=$enable_float8_byval;
-  case $enableval in
-    yes)
-      :
-      ;;
-    no)
-      :
-      ;;
-    *)
-      as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5
-      ;;
-  esac
-
-else
-  enable_float8_byval=yes
-
-fi
-
-
-else
-
-
-# Check whether --enable-float8-byval was given.
-if test "${enable_float8_byval+set}" = set; then :
-  enableval=$enable_float8_byval;
-  case $enableval in
-    yes)
-      :
-      ;;
-    no)
-      :
-      ;;
-    *)
-      as_fn_error $? "no argument expected for --enable-float8-byval option" "$LINENO" 5
-      ;;
-  esac
-
-else
-  enable_float8_byval=no
-
-fi
-
-
-  if test "$enable_float8_byval" = yes ; then
-    as_fn_error $? "--enable-float8-byval is not supported on 32-bit platforms." "$LINENO" 5
-  fi
-fi
-if test "$enable_float8_byval" = yes ; then
-
-$as_echo "#define USE_FLOAT8_BYVAL 1" >>confdefs.h
-
-  float8passbyval=true
-else
-  float8passbyval=false
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_float8_byval" >&5
-$as_echo "$enable_float8_byval" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define FLOAT8PASSBYVAL $float8passbyval
-_ACEOF
-
-
 # Determine memory alignment requirements for the basic C data types.
 
 # The cast to long int works around a bug in the HP C Compiler,
index 56a177ba10299e42518a6df73725cef8b8e339d6..a2cb20b5e38bd4187450b37c05af1a79ccb22acb 100644 (file)
@@ -1941,29 +1941,6 @@ AC_CHECK_SIZEOF([void *])
 AC_CHECK_SIZEOF([size_t])
 AC_CHECK_SIZEOF([long])
 
-# Decide whether float8 is passed by value.
-# Note: this setting also controls int8 and related types such as timestamp.
-# If sizeof(Datum) >= 8, this is user-selectable, enabled by default.
-# If not, trying to select it is an error.
-AC_MSG_CHECKING([whether to build with float8 passed by value])
-if test $ac_cv_sizeof_void_p -ge 8 ; then
-  PGAC_ARG_BOOL(enable, float8-byval, yes, [disable float8 passed by value])
-else
-  PGAC_ARG_BOOL(enable, float8-byval, no, [disable float8 passed by value])
-  if test "$enable_float8_byval" = yes ; then
-    AC_MSG_ERROR([--enable-float8-byval is not supported on 32-bit platforms.])
-  fi
-fi
-if test "$enable_float8_byval" = yes ; then
-  AC_DEFINE([USE_FLOAT8_BYVAL], 1,
-            [Define to 1 if you want float8, int8, etc values to be passed by value. (--enable-float8-byval)])
-  float8passbyval=true
-else
-  float8passbyval=false
-fi
-AC_MSG_RESULT([$enable_float8_byval])
-AC_DEFINE_UNQUOTED([FLOAT8PASSBYVAL], [$float8passbyval], [float8, int8, and related values are passed by value if 'true', by reference if 'false'])
-
 # Determine memory alignment requirements for the basic C data types.
 
 AC_CHECK_ALIGNOF(short)
index b4d222295e18739fc692b4d9a4eddc14c64c9211..9c10a897f19523389d9a2e06040d35d833b5ef0a 100644 (file)
@@ -1204,22 +1204,6 @@ build-postgresql:
        </listitem>
       </varlistentry>
 
-      <varlistentry>
-       <term><option>--disable-float8-byval</option></term>
-       <listitem>
-        <para>
-         Disable passing float8 values <quote>by value</quote>, causing them
-         to be passed <quote>by reference</quote> instead.  This option costs
-         performance, but may be needed for compatibility with very old
-         user-defined functions written in C.
-         Note that this option affects not only float8, but also int8 and some
-         related types such as timestamp.
-         On 32-bit platforms, <option>--disable-float8-byval</option> is the default
-         and it is not allowed to select <option>--enable-float8-byval</option>.
-        </para>
-       </listitem>
-      </varlistentry>
-
       <varlistentry>
        <term><option>--disable-spinlocks</option></term>
        <listitem>
index 802a731267f337931e56c806590bc13193fc8a93..00e41ac546a28d7f5ce36b350bc2c41a6d225703 100644 (file)
@@ -491,6 +491,12 @@ typedef signed int Offset;
 typedef float float4;
 typedef double float8;
 
+#ifdef USE_FLOAT8_BYVAL
+#define FLOAT8PASSBYVAL true
+#else
+#define FLOAT8PASSBYVAL false
+#endif
+
 /*
  * Oid, RegProcedure, TransactionId, SubTransactionId, MultiXactId,
  * CommandId
index 6f8549bc03b1f59d835e4eeddd67240e40c84a2e..c208dcdfc7155c249ca6c76c8e5b4825f28423e8 100644 (file)
    MSVC and with C++ compilers. */
 #undef FLEXIBLE_ARRAY_MEMBER
 
-/* float8, int8, and related values are passed by value if 'true', by
-   reference if 'false' */
-#undef FLOAT8PASSBYVAL
-
 /* Define to 1 if gettimeofday() takes only 1 argument. */
 #undef GETTIMEOFDAY_1ARG
 
 /* Define to use /dev/urandom for random number generation */
 #undef USE_DEV_URANDOM
 
-/* Define to 1 if you want float8, int8, etc values to be passed by value.
-   (--enable-float8-byval) */
-#undef USE_FLOAT8_BYVAL
-
 /* Define to build with ICU support. (--with-icu) */
 #undef USE_ICU
 
index 743401cb9698085bdc736e1d428a06158dad7864..61b667d16630963c30dc3dd430006c42560df61d 100644 (file)
  */
 #define PARTITION_MAX_KEYS 32
 
+/*
+ * Decide whether built-in 8-byte types, including float8, int8, and
+ * timestamp, are passed by value.  This is on by default if sizeof(Datum) >=
+ * 8 (that is, on 64-bit platforms).  If sizeof(Datum) < 8 (32-bit platforms),
+ * this must be off.  We keep this here as an option so that it is easy to
+ * test the pass-by-reference code paths on 64-bit platforms.
+ *
+ * Changing this requires an initdb.
+ */
+#if SIZEOF_VOID_P >= 8
+#define USE_FLOAT8_BYVAL 1
+#endif
+
 /*
  * When we don't have native spinlocks, we use semaphores to simulate them.
  * Decreasing this value reduces consumption of OS resources; increasing it
index e4ea62e80ba276ea34239263562a5a5490ab36e7..5f72530c72b80e76ebd8907d41d7153c3439ca52 100644 (file)
@@ -29,12 +29,7 @@ sub _new
    bless($self, $classname);
 
    $self->DeterminePlatform();
-   my $bits = $self->{platform} eq 'Win32' ? 32 : 64;
 
-   $options->{float8byval} = ($bits == 64)
-     unless exists $options->{float8byval};
-   die "float8byval not permitted on 32 bit platforms"
-     if $options->{float8byval} && $bits == 32;
    if ($options->{xslt} && !$options->{xml})
    {
        die "XSLT requires XML\n";
@@ -207,16 +202,6 @@ sub GenerateFiles
        print $o "#define XLOG_BLCKSZ ",
          1024 * $self->{options}->{wal_blocksize}, "\n";
 
-       if ($self->{options}->{float8byval})
-       {
-           print $o "#define USE_FLOAT8_BYVAL 1\n";
-           print $o "#define FLOAT8PASSBYVAL true\n";
-       }
-       else
-       {
-           print $o "#define FLOAT8PASSBYVAL false\n";
-       }
-
        if ($self->{options}->{uuid})
        {
            print $o "#define HAVE_UUID_OSSP\n";
index 62188c78e78f8ff9b685d59bf0ba613ad702ec9b..2ef2cfc4e995a56908438ef6efe9fb807652a9d8 100644 (file)
@@ -5,9 +5,6 @@ use warnings;
 our $config = {
    asserts => 0,    # --enable-cassert
 
-   # float8byval=> $platformbits == 64, # --disable-float8-byval,
-   # off by default on 32 bit platforms, on by default on 64 bit platforms
-
    # blocksize => 8,         # --with-blocksize, 8kB by default
    # wal_blocksize => 8,     # --with-wal-blocksize, 8kB by default
    ldap      => 1,        # --with-ldap