summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan Bossart2025-04-04 20:56:23 +0000
committerNathan Bossart2025-04-04 20:56:23 +0000
commit8ec0aaeae09482925d2d15ce4a91f6953bdb1566 (patch)
tree1514ab8708f675aad8ce50bbda76b4f9e773a131 /src
parent289f74d0cb247ebdb443fec65fb2500531c961b4 (diff)
Prevent redeclaration of typedef TocEntry.
Commit 9c02e3a986 added a forward declaration for this typedef that caused redeclarations, which is not valid in C99. To fix, add some preprocessor guards to avoid a redefinition, as is done elsewhere (e.g., commit 382092a0cd). Per buildfarm.
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/pg_backup.h3
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.h3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h
index 5c8c1b3ea0a..8586cdaf541 100644
--- a/src/bin/pg_dump/pg_backup.h
+++ b/src/bin/pg_dump/pg_backup.h
@@ -286,7 +286,10 @@ typedef int DumpId;
*/
/* forward declaration to avoid including pg_backup_archiver.h here */
+#ifndef HAVE_TOCENTRY_TYPEDEF
typedef struct _tocEntry TocEntry;
+#define HAVE_TOCENTRY_TYPEDEF 1
+#endif
typedef char *(*DefnDumperPtr) (Archive *AH, const void *userArg, const TocEntry *te);
typedef int (*DataDumperPtr) (Archive *AH, const void *userArg);
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index 859fbd322d1..e81a76ba25e 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -97,7 +97,10 @@
#define WORKER_IGNORED_ERRORS 12
typedef struct _archiveHandle ArchiveHandle;
+#ifndef HAVE_TOCENTRY_TYPEDEF
typedef struct _tocEntry TocEntry;
+#define HAVE_TOCENTRY_TYPEDEF 1
+#endif
struct ParallelState;
#define READ_ERROR_EXIT(fd) \