mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Generate fmgr prototypes automatically
Gen_fmgrtab.pl creates a new file fmgrprotos.h, which contains prototypes for all functions registered in pg_proc.h. This avoids having to manually maintain these prototypes across a random variety of header files. It also automatically enforces a correct function signature, and since there are warnings about missing prototypes, it will detect functions that are defined but not registered in pg_proc.h (or otherwise used). Reviewed-by: Pavel Stehule <pavel.stehule@gmail.com>
This commit is contained in:
@ -268,7 +268,7 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
|
||||
if (IsNewer(
|
||||
'src/backend/utils/fmgrtab.c', 'src/include/catalog/pg_proc.h'))
|
||||
{
|
||||
print "Generating fmgrtab.c and fmgroids.h...\n";
|
||||
print "Generating fmgrtab.c, fmgroids.h, fmgrprotos.h...\n";
|
||||
chdir('src/backend/utils');
|
||||
system(
|
||||
"perl -I ../catalog Gen_fmgrtab.pl ../../../src/include/catalog/pg_proc.h");
|
||||
@ -282,6 +282,14 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
|
||||
'src/include/utils/fmgroids.h');
|
||||
}
|
||||
|
||||
if (IsNewer(
|
||||
'src/include/utils/fmgrprotos.h',
|
||||
'src/backend/utils/fmgrprotos.h'))
|
||||
{
|
||||
copyFile('src/backend/utils/fmgrprotos.h',
|
||||
'src/include/utils/fmgrprotos.h');
|
||||
}
|
||||
|
||||
if (IsNewer(
|
||||
'src/include/storage/lwlocknames.h',
|
||||
'src/backend/storage/lmgr/lwlocknames.txt'))
|
||||
|
Reference in New Issue
Block a user