From: Heikki Linnakangas Date: Mon, 6 Apr 2026 12:46:00 +0000 (+0300) Subject: Fix compilation without injection points with some compilers X-Git-Tag: REL_19_BETA1~457 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2670a0fcc6a5ee0273b0751dcc18d514735290ad;p=thirdparty%2Fpostgresql.git Fix compilation without injection points with some compilers Some compilers didn't like the empty initializer when compiled without USE_INJECTION_POINTS. Per buildfarm member 'drongo', using Visual Studio 2019. Author: Michael Paquier Discussion: https://www.postgresql.org/message-id/adNHcBVJO5gIOp1l@paquier.xyz --- diff --git a/src/backend/utils/misc/injection_point.c b/src/backend/utils/misc/injection_point.c index a7c99e097ea..aa455c62bcc 100644 --- a/src/backend/utils/misc/injection_point.c +++ b/src/backend/utils/misc/injection_point.c @@ -230,19 +230,15 @@ injection_point_cache_get(const char *name) return NULL; } -#endif /* USE_INJECTION_POINTS */ const ShmemCallbacks InjectionPointShmemCallbacks = { -#ifdef USE_INJECTION_POINTS .request_fn = InjectionPointShmemRequest, .init_fn = InjectionPointShmemInit, -#endif }; /* * Reserve space for the dynamic shared hash table */ -#ifdef USE_INJECTION_POINTS static void InjectionPointShmemRequest(void *arg) { @@ -259,7 +255,7 @@ InjectionPointShmemInit(void *arg) for (int i = 0; i < MAX_INJECTION_POINTS; i++) pg_atomic_init_u64(&ActiveInjectionPoints->entries[i].generation, 0); } -#endif +#endif /* USE_INJECTION_POINTS */ /* * Attach a new injection point. diff --git a/src/include/storage/subsystemlist.h b/src/include/storage/subsystemlist.h index 5e092552c72..9ad619080be 100644 --- a/src/include/storage/subsystemlist.h +++ b/src/include/storage/subsystemlist.h @@ -79,7 +79,9 @@ PG_SHMEM_SUBSYSTEM(SyncScanShmemCallbacks) PG_SHMEM_SUBSYSTEM(AsyncShmemCallbacks) PG_SHMEM_SUBSYSTEM(StatsShmemCallbacks) PG_SHMEM_SUBSYSTEM(WaitEventCustomShmemCallbacks) +#ifdef USE_INJECTION_POINTS PG_SHMEM_SUBSYSTEM(InjectionPointShmemCallbacks) +#endif PG_SHMEM_SUBSYSTEM(WaitLSNShmemCallbacks) PG_SHMEM_SUBSYSTEM(LogicalDecodingCtlShmemCallbacks) PG_SHMEM_SUBSYSTEM(DataChecksumsShmemCallbacks)