summaryrefslogtreecommitdiff
path: root/src/include/fmgr.h
diff options
context:
space:
mode:
authorPeter Eisentraut2021-11-22 06:40:17 +0000
committerPeter Eisentraut2021-11-22 07:00:14 +0000
commitd6d1dfcc99e3dd6e70e2a7024924e491bb7a9670 (patch)
tree6fef3affc3f8e081be88963d4ccb677f8909486b /src/include/fmgr.h
parent1b06d7bac901e5fd20bba597188bae2882bf954b (diff)
Add ABI extra field to fmgr magic block
This allows derived products to intentionally make their fmgr ABI incompatible, with a clean error message. Discussion: https://www.postgresql.org/message-id/flat/55215fda-db31-a045-d6b7-d6f2d2dc9920%40enterprisedb.com
Diffstat (limited to 'src/include/fmgr.h')
-rw-r--r--src/include/fmgr.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/include/fmgr.h b/src/include/fmgr.h
index ab7b85c86e1..cec663bdff0 100644
--- a/src/include/fmgr.h
+++ b/src/include/fmgr.h
@@ -458,6 +458,7 @@ typedef struct
int indexmaxkeys; /* INDEX_MAX_KEYS */
int namedatalen; /* NAMEDATALEN */
int float8byval; /* FLOAT8PASSBYVAL */
+ char abi_extra[32]; /* see pg_config_manual.h */
} Pg_magic_struct;
/* The actual data block contents */
@@ -468,9 +469,13 @@ typedef struct
FUNC_MAX_ARGS, \
INDEX_MAX_KEYS, \
NAMEDATALEN, \
- FLOAT8PASSBYVAL \
+ FLOAT8PASSBYVAL, \
+ FMGR_ABI_EXTRA, \
}
+StaticAssertDecl(sizeof(FMGR_ABI_EXTRA) <= sizeof(((Pg_magic_struct*)0)->abi_extra),
+ "FMGR_ABI_EXTRA too long");
+
/*
* Declare the module magic function. It needs to be a function as the dlsym
* in the backend is only guaranteed to work on functions, not data