v1-0001-Move-Windows-pthread-compatibility-functions-to-s.patch
text/x-patch
Filename: v1-0001-Move-Windows-pthread-compatibility-functions-to-s.patch
Type: text/x-patch
Part: 0
From 0a1d3b5894502a25a2c5ed5a283251e3296ae413 Mon Sep 17 00:00:00 2001
From: Jelte Fennema-Nio <postgres@jeltef.nl>
Date: Sat, 13 Dec 2025 18:18:13 +0100
Subject: [PATCH v1 1/2] Move Windows pthread compatibility functions to
src/port
This is in preparation of a follow-up commit which will start to use
these functions in more places than just libpq.
---
configure.ac | 1 +
src/interfaces/libpq/Makefile | 1 -
src/interfaces/libpq/meson.build | 2 +-
src/port/meson.build | 1 +
src/{interfaces/libpq => port}/pthread-win32.c | 5 +++--
5 files changed, 6 insertions(+), 4 deletions(-)
rename src/{interfaces/libpq => port}/pthread-win32.c (94%)
diff --git a/configure.ac b/configure.ac
index 4ba3967db0f..e73e1287bf4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1887,6 +1887,7 @@ if test "$PORTNAME" = "win32"; then
AC_LIBOBJ(dirmod)
AC_LIBOBJ(kill)
AC_LIBOBJ(open)
+ AC_LIBOBJ(pthread-win32)
AC_LIBOBJ(system)
AC_LIBOBJ(win32common)
AC_LIBOBJ(win32dlopen)
diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index 9fe321147fc..98cfe42db34 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -75,7 +75,6 @@ endif
ifeq ($(PORTNAME), win32)
OBJS += \
- pthread-win32.o \
win32.o
endif
diff --git a/src/interfaces/libpq/meson.build b/src/interfaces/libpq/meson.build
index b259c998fa2..eb8bf7b45bf 100644
--- a/src/interfaces/libpq/meson.build
+++ b/src/interfaces/libpq/meson.build
@@ -20,7 +20,7 @@ libpq_sources = files(
libpq_so_sources = [] # for shared lib, in addition to the above
if host_system == 'windows'
- libpq_sources += files('pthread-win32.c', 'win32.c')
+ libpq_sources += files('win32.c')
libpq_so_sources += rc_lib_gen.process(win32ver_rc, extra_args: [
'--NAME', 'libpq',
'--FILEDESC', 'PostgreSQL Access Library',])
diff --git a/src/port/meson.build b/src/port/meson.build
index fc7b059fee5..c1e53a9a341 100644
--- a/src/port/meson.build
+++ b/src/port/meson.build
@@ -31,6 +31,7 @@ if host_system == 'windows'
'dirmod.c',
'kill.c',
'open.c',
+ 'pthread-win32.c',
'system.c',
'win32common.c',
'win32dlopen.c',
diff --git a/src/interfaces/libpq/pthread-win32.c b/src/port/pthread-win32.c
similarity index 94%
rename from src/interfaces/libpq/pthread-win32.c
rename to src/port/pthread-win32.c
index db75d491b90..f3e5e08cb09 100644
--- a/src/interfaces/libpq/pthread-win32.c
+++ b/src/port/pthread-win32.c
@@ -4,13 +4,14 @@
* partial pthread implementation for win32
*
* Copyright (c) 2004-2025, PostgreSQL Global Development Group
+*
* IDENTIFICATION
-* src/interfaces/libpq/pthread-win32.c
+* src/port/pthread-win32.c
*
*-------------------------------------------------------------------------
*/
-#include "postgres_fe.h"
+#include "c.h"
#include "pthread-win32.h"
base-commit: c5ae07a90a0f3594e5053a26f3c99b041df427d3
--
2.52.0