From 2e4db241bfd3206bad8286f8ffc2db6bbdaefcdf Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 21 Nov 2019 18:00:07 +0100 Subject: Remove configure --disable-float4-byval This build option was only useful to maintain compatibility for version-0 functions, but those are no longer supported, so this option can be removed. float4 is now always pass-by-value; the pass-by-reference code path is completely removed. Discussion: https://www.postgresql.org/message-id/flat/f3e1e576-2749-bbd7-2d57-3f9dcf75255a@2ndquadrant.com --- src/include/postgres.h | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'src/include/postgres.h') diff --git a/src/include/postgres.h b/src/include/postgres.h index 057a3413acd..f5b7c52f8a8 100644 --- a/src/include/postgres.h +++ b/src/include/postgres.h @@ -659,11 +659,7 @@ extern Datum Int64GetDatum(int64 X); /* * DatumGetFloat4 * Returns 4-byte floating point value of a datum. - * - * Note: this macro hides whether float4 is pass by value or by reference. */ - -#ifdef USE_FLOAT4_BYVAL static inline float4 DatumGetFloat4(Datum X) { @@ -676,18 +672,11 @@ DatumGetFloat4(Datum X) myunion.value = DatumGetInt32(X); return myunion.retval; } -#else -#define DatumGetFloat4(X) (* ((float4 *) DatumGetPointer(X))) -#endif /* * Float4GetDatum * Returns datum representation for a 4-byte floating point number. - * - * Note: if float4 is pass by reference, this function returns a reference - * to palloc'd space. */ -#ifdef USE_FLOAT4_BYVAL static inline Datum Float4GetDatum(float4 X) { @@ -700,9 +689,6 @@ Float4GetDatum(float4 X) myunion.value = X; return Int32GetDatum(myunion.retval); } -#else -extern Datum Float4GetDatum(float4 X); -#endif /* * DatumGetFloat8 @@ -757,10 +743,9 @@ extern Datum Float8GetDatum(float8 X); /* * Int64GetDatumFast * Float8GetDatumFast - * Float4GetDatumFast * * These macros are intended to allow writing code that does not depend on - * whether int64, float8, float4 are pass-by-reference types, while not + * whether int64 and float8 are pass-by-reference types, while not * sacrificing performance when they are. The argument must be a variable * that will exist and have the same value for as long as the Datum is needed. * In the pass-by-ref case, the address of the variable is taken to use as @@ -776,10 +761,4 @@ extern Datum Float8GetDatum(float8 X); #define Float8GetDatumFast(X) PointerGetDatum(&(X)) #endif -#ifdef USE_FLOAT4_BYVAL -#define Float4GetDatumFast(X) Float4GetDatum(X) -#else -#define Float4GetDatumFast(X) PointerGetDatum(&(X)) -#endif - #endif /* POSTGRES_H */ -- cgit v1.2.3