diff options
Diffstat (limited to 'src/fe_utils')
-rw-r--r-- | src/fe_utils/Makefile | 4 | ||||
-rw-r--r-- | src/fe_utils/meson.build | 1 | ||||
-rw-r--r-- | src/fe_utils/parallel_slot.c | 4 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/fe_utils/Makefile b/src/fe_utils/Makefile index 44bc7a1215d..72966769a52 100644 --- a/src/fe_utils/Makefile +++ b/src/fe_utils/Makefile @@ -34,6 +34,10 @@ OBJS = \ simple_list.o \ string_utils.o +ifeq ($(PORTNAME), win32) +override CPPFLAGS += -DFD_SETSIZE=1024 +endif + all: libpgfeutils.a libpgfeutils.a: $(OBJS) diff --git a/src/fe_utils/meson.build b/src/fe_utils/meson.build index b6bf8e1ca21..3e226c260ac 100644 --- a/src/fe_utils/meson.build +++ b/src/fe_utils/meson.build @@ -24,6 +24,7 @@ fe_utils_sources += psqlscan fe_utils = static_library('libpgfeutils', fe_utils_sources + generated_headers, include_directories: [postgres_inc, libpq_inc], + c_args: host_system == 'windows' ? ['-DFD_SETSIZE=1024'] : [], dependencies: frontend_common_code, kwargs: default_lib_args, ) diff --git a/src/fe_utils/parallel_slot.c b/src/fe_utils/parallel_slot.c index 2be2903c9c6..767256757f2 100644 --- a/src/fe_utils/parallel_slot.c +++ b/src/fe_utils/parallel_slot.c @@ -12,8 +12,8 @@ *------------------------------------------------------------------------- */ -#ifdef WIN32 -#define FD_SETSIZE 1024 /* must set before winsock2.h is included */ +#if defined(WIN32) && FD_SETSIZE < 1024 +#error FD_SETSIZE needs to have been increased #endif #include "postgres_fe.h" |