diff options
| author | Peter Eisentraut | 2016-12-28 17:00:00 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2017-01-17 19:06:07 +0000 |
| commit | 352a24a1f9d6f7d4abb1175bfd22acc358f43140 (patch) | |
| tree | a27b51c7ceb1d5e50a7b7a1f1a74230043f204a6 /src/tools | |
| parent | 323b96aa34239b5a8fe773d614a6ee50d731a683 (diff) | |
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>
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/msvc/Solution.pm | 10 | ||||
| -rwxr-xr-x | src/tools/msvc/clean.bat | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 8217d06f28e..fbf4da3d68f 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -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"); @@ -283,6 +283,14 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY } 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')) { diff --git a/src/tools/msvc/clean.bat b/src/tools/msvc/clean.bat index e73df6e96f8..ab51284e643 100755 --- a/src/tools/msvc/clean.bat +++ b/src/tools/msvc/clean.bat @@ -42,9 +42,11 @@ if exist src\include\dynloader.h del /q src\include\dynloader.h if %DIST%==1 if exist src\backend\parser\gram.h del /q src\backend\parser\gram.h if exist src\include\utils\errcodes.h del /q src\include\utils\errcodes.h if exist src\include\utils\fmgroids.h del /q src\include\utils\fmgroids.h +if exist src\include\utils\fmgrprotos.h del /q src\include\utils\fmgrprotos.h if exist src\include\utils\probes.h del /q src\include\utils\probes.h if %DIST%==1 if exist src\backend\utils\fmgroids.h del /q src\backend\utils\fmgroids.h +if %DIST%==1 if exist src\backend\utils\fmgrprotos.h del /q src\backend\utils\fmgrprotos.h if %DIST%==1 if exist src\backend\utils\fmgrtab.c del /q src\backend\utils\fmgrtab.c if %DIST%==1 if exist src\backend\catalog\postgres.bki del /q src\backend\catalog\postgres.bki if %DIST%==1 if exist src\backend\catalog\postgres.description del /q src\backend\catalog\postgres.description |
