mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Add declaration-level assertions for compile-time checks
Those new assertions can be used at file scope, outside of any function for compilation checks. This commit provides implementations for C and C++, and fallback implementations. Author: Peter Smith Reviewed-by: Andres Freund, Kyotaro Horiguchi, Dagfinn Ilmari Mannsåker, Michael Paquier Discussion: https://postgr.es/m/201DD0641B056142AC8C6645EC1B5F62014B8E8030@SYD1217
This commit is contained in:
@ -37,6 +37,9 @@ const char *const forkNames[] = {
|
||||
"init" /* INIT_FORKNUM */
|
||||
};
|
||||
|
||||
StaticAssertDecl(lengthof(forkNames) == (MAX_FORKNUM + 1),
|
||||
"array length mismatch");
|
||||
|
||||
/*
|
||||
* forkname_to_number - look up fork number by name
|
||||
*
|
||||
|
Reference in New Issue
Block a user