aboutsummaryrefslogtreecommitdiff
path: root/src/include/postgres.h
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2019-11-21 18:00:07 +0100
committerPeter Eisentraut <peter@eisentraut.org>2019-11-21 18:29:21 +0100
commit2e4db241bfd3206bad8286f8ffc2db6bbdaefcdf (patch)
tree709eee963e46e556e7f6e54a2eceba236e816a9e /src/include/postgres.h
parent43a54a3bccd7dc6be798475214d561f3e93b3055 (diff)
downloadpostgresql-2e4db241bfd3206bad8286f8ffc2db6bbdaefcdf.tar.gz
postgresql-2e4db241bfd3206bad8286f8ffc2db6bbdaefcdf.zip
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
Diffstat (limited to 'src/include/postgres.h')
-rw-r--r--src/include/postgres.h23
1 files changed, 1 insertions, 22 deletions
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 */