]> granicus.if.org Git - postgresql/blobdiff - src/tools/msvc/Solution.pm
Avoid maintaining three separate copies of the error codes list.
[postgresql] / src / tools / msvc / Solution.pm
index b737e1ed9fcd7360f50da5e3f58b1142a61384b8..950e12b1f4c1b445fd9e2d71799eed9c775772d5 100644 (file)
@@ -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";