Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4be6a74

Browse files
committed
pg_dump: Tiny header cleanup
In commits9c02e3a and8ec0aae, Nathan added a duplicateTocEntry typedef forward declaration (plus assorted #ifdef hackery toavoid C99 preprocessor issues) to deal with some very old untidynessregarding DefnDumperPtr function prototype being located in pg_backup.h.But there's no reason to have the DefnDumperPtr typedef (and theaccompanying DataDumperPtr typedef) in that file at all; they are betterplaced in pg_backup_archiver.h, the internal header, because they areonly used internally. That also requires zero #ifdef hackery, so movethem there.Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/202504042140.qo66ggw6wzsz@alvherre.pgsql
1 parentf0d0083 commit4be6a74

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

‎src/bin/pg_dump/pg_backup.h‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -284,16 +284,6 @@ typedef int DumpId;
284284
/*
285285
* Function pointer prototypes for assorted callback methods.
286286
*/
287-
288-
/* forward declaration to avoid including pg_backup_archiver.h here */
289-
#ifndefHAVE_TOCENTRY_TYPEDEF
290-
typedefstruct_tocEntryTocEntry;
291-
#defineHAVE_TOCENTRY_TYPEDEF 1
292-
#endif
293-
294-
typedefchar*(*DefnDumperPtr) (Archive*AH,constvoid*userArg,constTocEntry*te);
295-
typedefint (*DataDumperPtr) (Archive*AH,constvoid*userArg);
296-
297287
typedefvoid (*SetupWorkerPtrType) (Archive*AH);
298288

299289
/*

‎src/bin/pg_dump/pg_backup_archiver.h‎

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

9999
typedefstruct_archiveHandleArchiveHandle;
100-
#ifndefHAVE_TOCENTRY_TYPEDEF
101100
typedefstruct_tocEntryTocEntry;
102-
#defineHAVE_TOCENTRY_TYPEDEF 1
103-
#endif
104101
structParallelState;
105102

106103
#defineREAD_ERROR_EXIT(fd) \
@@ -344,6 +341,10 @@ struct _archiveHandle
344341
struct_tocEntry*lastErrorTE;
345342
};
346343

344+
345+
typedefchar*(*DefnDumperPtr) (Archive*AH,constvoid*userArg,constTocEntry*te);
346+
typedefint (*DataDumperPtr) (Archive*AH,constvoid*userArg);
347+
347348
struct_tocEntry
348349
{
349350
struct_tocEntry*prev;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp