]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Use .h for the file containing the page checksum code fragment
authorJohn Naylor <john.naylor@postgresql.org>
Tue, 7 Apr 2026 08:52:55 +0000 (15:52 +0700)
committerJohn Naylor <john.naylor@postgresql.org>
Tue, 7 Apr 2026 08:52:55 +0000 (15:52 +0700)
Commit 5e13b0f24 used a .c file for a file containing a code fragment,
to avoid adding an exception to headerscheck. That turned out to be
too clever, since it meant installation didn't happen by the usual
mechanism. Make it look like a normal header and add the requisite
exception.

Bug: #19450
Reported-by: RekGRpth <rekgrpth@gmail.com>
Discussion: https://postgr.es/m/19450-bb0612c50c6786e5@postgresql.org

src/backend/storage/page/checksum.c
src/include/storage/checksum_block_internal.h [moved from src/include/storage/checksum_block.inc.c with 88% similarity]
src/include/storage/checksum_impl.h
src/tools/pginclude/headerscheck

index 7ce51fe9d2e8a93a8beab48a2ff81eedfd70ab9d..030c44f7308974f83b6342f057490f0c535bf5b7 100644 (file)
@@ -30,7 +30,7 @@
 static uint32
 pg_checksum_block_fallback(const PGChecksummablePage *page)
 {
-#include "storage/checksum_block.inc.c"
+#include "storage/checksum_block_internal.h"
 }
 
 /*
@@ -41,7 +41,7 @@ pg_attribute_target("avx2")
 static uint32
 pg_checksum_block_avx2(const PGChecksummablePage *page)
 {
-#include "storage/checksum_block.inc.c"
+#include "storage/checksum_block_internal.h"
 }
 #endif                                                 /* USE_AVX2_WITH_RUNTIME_CHECK */
 
similarity index 88%
rename from src/include/storage/checksum_block.inc.c
rename to src/include/storage/checksum_block_internal.h
index 6ef8a911145ea55db135c9c4159490ecf873bc70..b8338fed08dc0142b4f69d27a3f029b1a48beb42 100644 (file)
@@ -1,18 +1,18 @@
 /*-------------------------------------------------------------------------
  *
- * checksum_block.inc.c
+ * checksum_block_internal.h
  *       Core algorithm for page checksums, semi-private to checksum_impl.h
  *       and checksum.c.
  *
  * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * src/include/storage/checksum_block.inc.c
+ * src/include/storage/checksum_block_internal.h
  *
  *-------------------------------------------------------------------------
  */
 
-/* there is deliberately not an #ifndef CHECKSUM_BLOCK_INC_C here */
+/* there is deliberately not an #ifndef CHECKSUM_BLOCK_INTERNAL_H here */
 
 uint32         sums[N_SUMS];
 uint32         result = 0;
index 57a2e43c68748ce71d61356b1871ca3e84a9f981..576673b7b85055234f721cd4e960b57a46837cb6 100644 (file)
@@ -153,7 +153,7 @@ static uint32 (*pg_checksum_block) (const PGChecksummablePage *page);
 static uint32
 pg_checksum_block(const PGChecksummablePage *page)
 {
-#include "storage/checksum_block.inc.c"
+#include "storage/checksum_block_internal.h"
 }
 
 #endif
index 24f7416185e30c83c17a3ef093f3d7cb630bcbae..4834ded3719fcee8f4b3fc25b964ad3483202a38 100755 (executable)
@@ -120,9 +120,11 @@ do
        # sepgsql.h depends on headers that aren't there on most platforms.
        test "$f" = contrib/sepgsql/sepgsql.h && continue
 
-       # nodetags.h cannot be included standalone: it's just a code fragment.
+       # These files cannot be included standalone, because they contain
+       # code fragments.
        test "$f" = src/include/nodes/nodetags.h && continue
        test "$f" = src/backend/nodes/nodetags.h && continue
+       test "$f" = src/include/storage/checksum_block_internal.h && continue
 
        # These files are not meant to be included standalone, because
        # they contain lists that might have multiple use-cases.