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.
This commit is contained in:
Tom Lane 2013-03-24 15:35:37 -04:00
parent 9e257a181c
commit 846681fdd5
3 changed files with 9 additions and 11 deletions

View File

@ -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));

View File

@ -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
{

View File

@ -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);