Skip to content

Commit 8ec0aae

Browse files
Prevent redeclaration of typedef TocEntry.
Commit 9c02e3a 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 382092a). Per buildfarm.
1 parent 289f74d commit 8ec0aae

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/bin/pg_dump/pg_backup.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ typedef int DumpId;
286286
*/
287287

288288
/* forward declaration to avoid including pg_backup_archiver.h here */
289+
#ifndef HAVE_TOCENTRY_TYPEDEF
289290
typedef struct _tocEntry TocEntry;
291+
#define HAVE_TOCENTRY_TYPEDEF 1
292+
#endif
290293

291294
typedef char *(*DefnDumperPtr) (Archive *AH, const void *userArg, const TocEntry *te);
292295
typedef int (*DataDumperPtr) (Archive *AH, const void *userArg);

src/bin/pg_dump/pg_backup_archiver.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@
9797
#define WORKER_IGNORED_ERRORS 12
9898

9999
typedef struct _archiveHandle ArchiveHandle;
100+
#ifndef HAVE_TOCENTRY_TYPEDEF
100101
typedef struct _tocEntry TocEntry;
102+
#define HAVE_TOCENTRY_TYPEDEF 1
103+
#endif
101104
struct ParallelState;
102105

103106
#define READ_ERROR_EXIT(fd) \

0 commit comments

Comments
 (0)