From: Tom Lane Date: Sun, 24 Mar 2013 19:35:37 +0000 (-0400) Subject: Fix some unportable constructs in parallel pg_dump code. X-Git-Tag: REL9_3_BETA1~183 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=846681fdd574548d4f430f2ff7ab44d77b4c79fe;p=postgresql Fix some unportable constructs in parallel pg_dump code. Didn't compile on semi-obsolete gcc, and probably not on not-gcc-at-all either. --- diff --git a/src/bin/pg_dump/dumputils.h b/src/bin/pg_dump/dumputils.h index 90da787c5c..027ed1c7ce 100644 --- a/src/bin/pg_dump/dumputils.h +++ b/src/bin/pg_dump/dumputils.h @@ -44,6 +44,7 @@ typedef void (*on_exit_nicely_callback) (int code, void *arg); extern int quote_all_identifiers; extern const char *progname; +extern void (*on_exit_msg_func) (const char *modulename, const char *fmt, va_list ap); extern void init_parallel_dump_utils(void); extern const char *fmtId(const char *identifier); @@ -87,8 +88,6 @@ __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 0))); extern void exit_horribly(const char *modulename, const char *fmt,...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3), noreturn)); -extern void (*on_exit_msg_func) (const char *modulename, const char *fmt, va_list ap) - __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 0))); extern void on_exit_nicely(on_exit_nicely_callback function, void *arg); extern void exit_nicely(int code) __attribute__((noreturn)); diff --git a/src/bin/pg_dump/parallel.h b/src/bin/pg_dump/parallel.h index 858b2a09d2..7422f12db4 100644 --- a/src/bin/pg_dump/parallel.h +++ b/src/bin/pg_dump/parallel.h @@ -29,12 +29,6 @@ typedef enum WRKR_FINISHED } T_WorkerStatus; -typedef enum T_Action -{ - ACT_DUMP, - ACT_RESTORE, -} T_Action; - /* Arguments needed for a worker process */ typedef struct ParallelArgs { diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h index 2f9434efbc..59af815802 100644 --- a/src/bin/pg_dump/pg_backup_archiver.h +++ b/src/bin/pg_dump/pg_backup_archiver.h @@ -114,7 +114,12 @@ struct _tocEntry; struct _restoreList; struct ParallelArgs; struct ParallelState; -enum T_Action; + +typedef enum T_Action +{ + ACT_DUMP, + ACT_RESTORE +} T_Action; typedef void (*ClosePtr) (struct _archiveHandle * AH); typedef void (*ReopenPtr) (struct _archiveHandle * AH); @@ -145,9 +150,9 @@ typedef void (*DeClonePtr) (struct _archiveHandle * AH); typedef char *(*WorkerJobRestorePtr) (struct _archiveHandle * AH, struct _tocEntry * te); typedef char *(*WorkerJobDumpPtr) (struct _archiveHandle * AH, struct _tocEntry * te); typedef char *(*MasterStartParallelItemPtr) (struct _archiveHandle * AH, struct _tocEntry * te, - enum T_Action act); + T_Action act); typedef int (*MasterEndParallelItemPtr) (struct _archiveHandle * AH, struct _tocEntry * te, - const char *str, enum T_Action act); + const char *str, T_Action act); typedef size_t (*CustomOutPtr) (struct _archiveHandle * AH, const void *buf, size_t len);