diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-12-31 19:41:37 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-12-31 19:41:37 +0000 |
commit | 85d02a6586012edc385a420ebaca1c8ce4e93390 (patch) | |
tree | 4331782a9095429f06b9da7b200538d596d08380 /src/include/postgres.h | |
parent | 8abb0110479382b1873715052933f600d682654c (diff) | |
download | postgresql-85d02a6586012edc385a420ebaca1c8ce4e93390.tar.gz postgresql-85d02a6586012edc385a420ebaca1c8ce4e93390.zip |
Redefine Datum as uintptr_t, instead of unsigned long.
This is more in keeping with modern practice, and is a first step towards
porting to Win64 (which has sizeof(pointer) > sizeof(long)).
Tsutomu Yamada, Magnus Hagander, Tom Lane
Diffstat (limited to 'src/include/postgres.h')
-rw-r--r-- | src/include/postgres.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/include/postgres.h b/src/include/postgres.h index c1e4f77386f..ea6d81e52d2 100644 --- a/src/include/postgres.h +++ b/src/include/postgres.h @@ -10,7 +10,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1995, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/postgres.h,v 1.92 2009/01/01 17:23:55 momjian Exp $ + * $PostgreSQL: pgsql/src/include/postgres.h,v 1.93 2009/12/31 19:41:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -285,16 +285,10 @@ typedef struct /* * Port Notes: - * Postgres makes the following assumption about machines: - * - * sizeof(Datum) == sizeof(long) >= sizeof(void *) >= 4 - * - * Postgres also assumes that + * Postgres makes the following assumptions about datatype sizes: * + * sizeof(Datum) == sizeof(void *) == 4 or 8 * sizeof(char) == 1 - * - * and that - * * sizeof(short) == 2 * * When a type narrower than Datum is stored in a Datum, we place it in the @@ -305,9 +299,9 @@ typedef struct * or short may contain garbage when called as if it returned Datum. */ -typedef unsigned long Datum; /* XXX sizeof(long) >= sizeof(void *) */ +typedef uintptr_t Datum; -#define SIZEOF_DATUM SIZEOF_UNSIGNED_LONG +#define SIZEOF_DATUM SIZEOF_VOID_P typedef Datum *DatumPtr; |