diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-04-21 00:26:47 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-04-21 00:26:47 +0000 |
commit | 8472bf7a73487b0535c95e299773b882f7523463 (patch) | |
tree | f8cf1ad8529e819aec4d93cdcbf848996f4e3680 /src/backend/utils/adt/cash.c | |
parent | be939544a68f852107c912da2f35f5d36958deb2 (diff) |
Allow float8, int8, and related datatypes to be passed by value on machines
where Datum is 8 bytes wide. Since this will break old-style C functions
(those still using version 0 calling convention) that have arguments or
results of these types, provide a configure option to disable it and retain
the old pass-by-reference behavior. Likewise, provide a configure option
to disable the recently-committed float4 pass-by-value change.
Zoltan Boszormenyi, plus configurability stuff by me.
Diffstat (limited to 'src/backend/utils/adt/cash.c')
-rw-r--r-- | src/backend/utils/adt/cash.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/backend/utils/adt/cash.c b/src/backend/utils/adt/cash.c index 84e8c742ec5..befa27f9bb8 100644 --- a/src/backend/utils/adt/cash.c +++ b/src/backend/utils/adt/cash.c @@ -13,7 +13,7 @@ * this version handles 64 bit numbers and so can hold values up to * $92,233,720,368,547,758.07. * - * $PostgreSQL: pgsql/src/backend/utils/adt/cash.c,v 1.78 2008/03/25 22:42:43 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/cash.c,v 1.79 2008/04/21 00:26:45 tgl Exp $ */ #include "postgres.h" @@ -34,14 +34,6 @@ #define LAST_PAREN (TERMINATOR - 1) #define LAST_DIGIT (LAST_PAREN - 1) -/* - * Cash is a pass-by-ref SQL type, so we must pass and return pointers. - * These macros and support routine hide the pass-by-refness. - */ -#define PG_GETARG_CASH(n) (* ((Cash *) PG_GETARG_POINTER(n))) -#define PG_RETURN_CASH(x) return CashGetDatum(x) - - /************************************************************************* * Private routines @@ -99,15 +91,6 @@ num_word(Cash value) return buf; } /* num_word() */ -static Datum -CashGetDatum(Cash value) -{ - Cash *result = (Cash *) palloc(sizeof(Cash)); - - *result = value; - return PointerGetDatum(result); -} - /* cash_in() * Convert a string to a cash data type. |