Don't use double-quotes in #include's of system headers, redux.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 27 Apr 2025 17:23:19 +0000 (13:23 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 27 Apr 2025 17:23:19 +0000 (13:23 -0400)
This cleans up some loose ends left by commit e8ca9ed1d.  I hadn't
looked closely enough at these places before, but now I have.

The use of double-quoted #includes for Perl headers in plperl_system.h
seems to be simply a mistake introduced in 6c944bf3c and faithfully
copied forward since then.  (I had thought possibly it was required
by some weird Windows build setup, but there's no evidence of that in
our history.)

The occurrences in SectionMemoryManager.h and SectionMemoryManager.cpp
evidently stem from those files' origin as LLVM code.  It's
understandable that LLVM would treat their own files as needing
double-quoted #includes; but they're still system headers to us.

I also applied the same check to *.c files, and found a few other
random incorrect usages in both directions.

Our ECPG headers and test files routinely use angle brackets to refer
to ECPG headers.  I left those usages alone, since it seems reasonable
for an ECPG user to regard those headers as system headers.

src/backend/jit/llvm/SectionMemoryManager.cpp
src/backend/storage/buffer/bufmgr.c
src/bin/initdb/initdb.c
src/bin/pg_dump/compress_gzip.c
src/bin/pg_verifybackup/pg_verifybackup.c
src/include/jit/SectionMemoryManager.h
src/pl/plperl/plperl_system.h

index c4fbf15a961c2614debd0fa89ec855123d84f491..2171db5f382d0ba1c54053d755567f7d75a3aaac 100644 (file)
@@ -40,8 +40,8 @@
 #ifdef USE_LLVM_BACKPORT_SECTION_MEMORY_MANAGER
 
 #include "jit/SectionMemoryManager.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/Support/Process.h"
+#include <llvm/Support/MathExtras.h>
+#include <llvm/Support/Process.h>
 
 namespace llvm {
 namespace backport {
index fe0ceeadc13cedfb490a1dfb925b1819a6038090..0b317d2d809fb7c8794af3c27b1b24cfb9a16f02 100644 (file)
@@ -3333,7 +3333,7 @@ UnpinBufferNoOwner(BufferDesc *buf)
 #define ST_COMPARE(a, b) ckpt_buforder_comparator(a, b)
 #define ST_SCOPE static
 #define ST_DEFINE
-#include <lib/sort_template.h>
+#include "lib/sort_template.h"
 
 /*
  * BufferSync -- Write out all dirty buffers in the pool.
@@ -6450,7 +6450,7 @@ ScheduleBufferTagForWriteback(WritebackContext *wb_context, IOContext io_context
 #define ST_COMPARE(a, b) buffertag_comparator(&a->tag, &b->tag)
 #define ST_SCOPE static
 #define ST_DEFINE
-#include <lib/sort_template.h>
+#include "lib/sort_template.h"
 
 /*
  * Issue all pending writeback requests, previously scheduled with
index 2087690449de9191a7959435f410aea00cdc8bbd..08c6b5f8a38a784eff024fbef198ca31a79eb716 100644 (file)
@@ -61,7 +61,7 @@
 #include <time.h>
 
 #ifdef HAVE_SHM_OPEN
-#include "sys/mman.h"
+#include <sys/mman.h>
 #endif
 
 #include "access/xlog_internal.h"
index 23f617209e65e4bf2ccc0fbd5ac9f4ae5855931a..5a30ebf9bf5b5a239c3d7d6ddfb727d7b93fd35b 100644 (file)
@@ -18,7 +18,7 @@
 #include "pg_backup_utils.h"
 
 #ifdef HAVE_LIBZ
-#include "zlib.h"
+#include <zlib.h>
 
 /*----------------------
  * Compressor API
index 3ce233f3c20f4918ddd43ae7d6d9b46f8772a4e4..a034d5211233164ff1e379af6b432989d2ce13a0 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <dirent.h>
 #include <fcntl.h>
+#include <limits.h>
 #include <sys/stat.h>
 #include <time.h>
 
@@ -23,7 +24,6 @@
 #include "common/parse_manifest.h"
 #include "fe_utils/simple_list.h"
 #include "getopt_long.h"
-#include "limits.h"
 #include "pg_verifybackup.h"
 #include "pgtime.h"
 
index 6bed991bd2be9da8aa8dc76420a24321f973e840..924a99b0d333a0a938592e207ea49ac6cc9ab0ec 100644 (file)
 #ifndef LLVM_EXECUTIONENGINE_BACKPORT_SECTIONMEMORYMANAGER_H
 #define LLVM_EXECUTIONENGINE_BACKPORT_SECTIONMEMORYMANAGER_H
 
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
-#include "llvm/Support/Alignment.h"
-#include "llvm/Support/Memory.h"
+#include <llvm/ADT/SmallVector.h>
+#include <llvm/ExecutionEngine/RTDyldMemoryManager.h>
+#include <llvm/Support/Alignment.h>
+#include <llvm/Support/Memory.h>
 #include <cstdint>
 #include <string>
 #include <system_error>
index 57355ac1ed45d55f8e8aba7e3bd42edc7aebe010..4c09a5cc1592b990f1f286d172b149a10c643597 100644 (file)
@@ -82,8 +82,8 @@
  * can compile against MULTIPLICITY Perl builds without including XSUB.h.
  */
 #define PERL_NO_GET_CONTEXT
-#include "EXTERN.h"
-#include "perl.h"
+#include <EXTERN.h>
+#include <perl.h>
 
 /*
  * We want to include XSUB.h only within .xs files, because on some platforms
 #undef unlink
 #endif
 
-#include "XSUB.h"
+#include <XSUB.h>
 #endif
 
 /* put back our *printf macros ... this must match src/include/port.h */