Skip to content

Commit 5037e0e

Browse files
committed
fix(ci): use _DARWIN_C_SOURCE on macOS for PostgreSQL extension build
Replace _GNU_SOURCE with _DARWIN_C_SOURCE on macOS to expose preadv/pwritev declarations required by PostgreSQL headers. _GNU_SOURCE is now Linux-only.
1 parent 8105742 commit 5037e0e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docker/Makefile.postgresql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ PG_OBJS = $(PG_ALL_SRC:.c=.o)
5252
PG_EXTRA_CFLAGS ?=
5353
PG_CPPFLAGS = -I$(PG_INCLUDEDIR) -Isrc -Isrc/postgresql -Imodules/fractional-indexing -DCLOUDSYNC_POSTGRESQL_BUILD $(PG_EXTRA_CFLAGS)
5454
ifneq ($(OS),Windows_NT)
55-
PG_CPPFLAGS += -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE
55+
PG_CPPFLAGS += -D_POSIX_C_SOURCE=200809L
56+
UNAME_S := $(shell uname -s)
57+
ifeq ($(UNAME_S),Darwin)
58+
PG_CPPFLAGS += -D_DARWIN_C_SOURCE
59+
else
60+
PG_CPPFLAGS += -D_GNU_SOURCE
61+
endif
5662
endif
5763
PG_DEBUG ?= 0
5864
ifeq ($(PG_DEBUG),1)

0 commit comments

Comments
 (0)