aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/autovacuum.c3
-rw-r--r--src/bin/pg_dump/pg_backup.h3
-rw-r--r--src/include/storage/pmsignal.h4
-rw-r--r--src/include/storage/procsignal.h4
4 files changed, 8 insertions, 6 deletions
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 7d0877c95ec..dc3cf87abab 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -247,9 +247,10 @@ typedef enum
{
AutoVacForkFailed, /* failed trying to start a worker */
AutoVacRebalance, /* rebalance the cost limits */
- AutoVacNumSignals, /* must be last */
} AutoVacuumSignal;
+#define AutoVacNumSignals (AutoVacRebalance + 1)
+
/*
* Autovacuum workitem array, stored in AutoVacuumShmem->av_workItems. This
* list is mostly protected by AutovacuumLock, except that if an item is
diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h
index fbf5f1c515e..68ae2970ade 100644
--- a/src/bin/pg_dump/pg_backup.h
+++ b/src/bin/pg_dump/pg_backup.h
@@ -74,9 +74,10 @@ enum _dumpPreparedQueries
PREPQUERY_DUMPTABLEATTACH,
PREPQUERY_GETCOLUMNACLS,
PREPQUERY_GETDOMAINCONSTRAINTS,
- NUM_PREP_QUERIES /* must be last */
};
+#define NUM_PREP_QUERIES (PREPQUERY_GETDOMAINCONSTRAINTS + 1)
+
/* Parameters needed by ConnectDatabase; same for dump and restore */
typedef struct _connParams
{
diff --git a/src/include/storage/pmsignal.h b/src/include/storage/pmsignal.h
index 87ac91848bc..e5be0f121c2 100644
--- a/src/include/storage/pmsignal.h
+++ b/src/include/storage/pmsignal.h
@@ -40,10 +40,10 @@ typedef enum
PMSIGNAL_BACKGROUND_WORKER_CHANGE, /* background worker state change */
PMSIGNAL_START_WALRECEIVER, /* start a walreceiver */
PMSIGNAL_ADVANCE_STATE_MACHINE, /* advance postmaster's state machine */
-
- NUM_PMSIGNALS /* Must be last value of enum! */
} PMSignalReason;
+#define NUM_PMSIGNALS (PMSIGNAL_ADVANCE_STATE_MACHINE+1)
+
/*
* Reasons why the postmaster would send SIGQUIT to its children.
*/
diff --git a/src/include/storage/procsignal.h b/src/include/storage/procsignal.h
index f94c11a9a84..221073def38 100644
--- a/src/include/storage/procsignal.h
+++ b/src/include/storage/procsignal.h
@@ -47,10 +47,10 @@ typedef enum
PROCSIG_RECOVERY_CONFLICT_BUFFERPIN,
PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK,
PROCSIG_RECOVERY_CONFLICT_LAST = PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK,
-
- NUM_PROCSIGNALS /* Must be last! */
} ProcSignalReason;
+#define NUM_PROCSIGNALS (PROCSIG_RECOVERY_CONFLICT_LAST + 1)
+
typedef enum
{
PROCSIGNAL_BARRIER_SMGRRELEASE, /* ask smgr to close files */