aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÁlvaro Herrera <alvherre@alvh.no-ip.org>2025-04-05 11:22:40 +0200
committerÁlvaro Herrera <alvherre@alvh.no-ip.org>2025-04-05 11:22:40 +0200
commit4be6a74cfb1ef4c50740e4c2f97a3b478c16de73 (patch)
tree803f6beafafca600fff29afcd1ae3fe0b3c784d9
parentf0d0083f52f994989b1bb6723e7bd0fad9f586cd (diff)
downloadpostgresql-4be6a74cfb1ef4c50740e4c2f97a3b478c16de73.tar.gz
postgresql-4be6a74cfb1ef4c50740e4c2f97a3b478c16de73.zip
pg_dump: Tiny header cleanup
In commits 9c02e3a986da and 8ec0aaeae094, Nathan added a duplicate TocEntry typedef forward declaration (plus assorted #ifdef hackery to avoid C99 preprocessor issues) to deal with some very old untidyness regarding DefnDumperPtr function prototype being located in pg_backup.h. But there's no reason to have the DefnDumperPtr typedef (and the accompanying DataDumperPtr typedef) in that file at all; they are better placed in pg_backup_archiver.h, the internal header, because they are only used internally. That also requires zero #ifdef hackery, so move them there. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/202504042140.qo66ggw6wzsz@alvherre.pgsql
-rw-r--r--src/bin/pg_dump/pg_backup.h10
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.h7
2 files changed, 4 insertions, 13 deletions
diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h
index 8586cdaf541..af0007fb6d2 100644
--- a/src/bin/pg_dump/pg_backup.h
+++ b/src/bin/pg_dump/pg_backup.h
@@ -284,16 +284,6 @@ typedef int DumpId;
/*
* Function pointer prototypes for assorted callback methods.
*/
-
-/* 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);
-
typedef void (*SetupWorkerPtrType) (Archive *AH);
/*
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index e81a76ba25e..365073b3eae 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -97,10 +97,7 @@
#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) \
@@ -344,6 +341,10 @@ struct _archiveHandle
struct _tocEntry *lastErrorTE;
};
+
+typedef char *(*DefnDumperPtr) (Archive *AH, const void *userArg, const TocEntry *te);
+typedef int (*DataDumperPtr) (Archive *AH, const void *userArg);
+
struct _tocEntry
{
struct _tocEntry *prev;