summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorRobert Haas2011-02-04 03:32:49 +0000
committerRobert Haas2011-02-04 03:32:49 +0000
commitddfe26f6441c24660595c5efe5fd0bd3974cdc5c (patch)
treef3e47e35a043c23916032317415154e117e9a59f /src/tools
parent7212c77d0cabcc468fec0b9cd7f2413b64b77050 (diff)
Avoid maintaining three separate copies of the error codes list.
src/pl/plpgsql/src/plerrcodes.h, src/include/utils/errcodes.h, and a big chunk of errcodes.sgml are now automatically generated from a single file, src/backend/utils/errcodes.txt. Jan UrbaƄski, reviewed by Tom Lane.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/msvc/Solution.pm13
-rwxr-xr-xsrc/tools/msvc/builddoc.bat1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index b737e1ed9fc..950e12b1f4c 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -273,6 +273,19 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
);
}
+ if (IsNewer('src\include\utils\errcodes.h','src\backend\utils\errcodes.txt'))
+ {
+ print "Generating errcodes.h...\n";
+ system("perl src\backend\utils\generate-errcodes.pl src\backend\utils\errcodes.txt > src\backend\utils\errcodes.h");
+ copyFile('src\backend\utils\errcodes.h','src\include\utils\errcodes.h');
+ }
+
+ if (IsNewer('src\pl\plpgsql\src\plerrcodes.h','src\backend\utils\errcodes.txt'))
+ {
+ print "Generating plerrcodes.h...\n";
+ system("perl src\pl\plpgsql\src\generate-plerrcodes.pl src\backend\utils\errcodes.txt > src\pl\plpgsql\src\plerrcodes.h");
+ }
+
if (IsNewer('src\interfaces\libpq\libpq.rc','src\interfaces\libpq\libpq.rc.in'))
{
print "Generating libpq.rc...\n";
diff --git a/src/tools/msvc/builddoc.bat b/src/tools/msvc/builddoc.bat
index 81c97ab6e4c..dc76c7e0484 100755
--- a/src/tools/msvc/builddoc.bat
+++ b/src/tools/msvc/builddoc.bat
@@ -32,6 +32,7 @@ SET SGML_CATALOG_FILES=%DOCROOT%\%OPENJADE%\dsssl\catalog;%DOCROOT%\docbook\docb
perl %DOCROOT%\%DSSSL%\bin\collateindex.pl -f -g -o bookindex.sgml -N
perl mk_feature_tables.pl YES ..\..\..\src\backend\catalog\sql_feature_packages.txt ..\..\..\src\backend\catalog\sql_features.txt > features-supported.sgml
perl mk_feature_tables.pl NO ..\..\..\src\backend\catalog\sql_feature_packages.txt ..\..\..\src\backend\catalog\sql_features.txt > features-unsupported.sgml
+perl make-errcodes-table.pl ..\..\..\src\backend\utils\errcodes.txt > errcodes-table.sgml
echo Running first build...
%DOCROOT%\%OPENJADE%\bin\openjade -V draft-mode -wall -wno-unused-param -wno-empty -D . -c %DOCROOT%\%DSSSL%\catalog -d stylesheet.dsl -i output-html -t sgml postgres.sgml 2>&1 | findstr /V "DTDDECL catalog entries are not supported"