From 3d0d525c7da0d33b4f53547b90890a745d796f5a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net>
Date: Sat, 19 Feb 2022 17:00:20 -0500
Subject: [PATCH] Use MinGW32 types for pthread_t and pthread_mutex_t

uintptr_t should be the same as a DWORD on Win32,
and CRITICAL_SECTION can be stored in an inptr_t as well.

This should work fine, and allow more build environments to be happy.
This is generally caused by new C++ standards having thread support
in the standard library, so wrappers getting pushed deeper in.

At some pointer, this should be redone with standard threads, but
now is not the time.
---
 src/xpdev/threadwrap.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/xpdev/threadwrap.h b/src/xpdev/threadwrap.h
index 29638b532e..a2098ad519 100644
--- a/src/xpdev/threadwrap.h
+++ b/src/xpdev/threadwrap.h
@@ -64,7 +64,7 @@ extern "C" {
 	#include <errno.h>		/* EAGAIN and EBUSY */
 
 	/* POSIX threads */
-	typedef DWORD pthread_t;
+	typedef uintptr_t pthread_t;
 	#define pthread_self()				GetCurrentThreadId()
 	#define pthread_equal(t1,t2)		((t1)==(t2))
 
@@ -75,7 +75,7 @@ extern "C" {
 
 	#else	/* Implemented as Win32 Critical Sections */
 
-		typedef CRITICAL_SECTION pthread_mutex_t;
+		typedef intptr_t pthread_mutex_t;
 
 	#endif
 
-- 
GitLab