Files
MINGW-packages/mingw-w64-libspatialite/0002-use-win32-mutex-locks.patch
Biswapriyo Nath 0f4cb799db libspatialite: Fix build for clang
autoreconf for clang
2021-08-08 09:07:38 +05:30

39 lines
1.0 KiB
Diff

--- a/src/connection_cache/alloc_cache.c
+++ b/src/connection_cache/alloc_cache.c
@@ -51,7 +51,7 @@
#include <libloaderapi.h>
#endif
-#if defined(_WIN32) && !defined(__MINGW32__)
+#if defined(_WIN32)
#include <windows.h>
#else
#include <pthread.h>
@@ -110,7 +110,7 @@
/* GLOBAL semaphores */
int gaia_already_initialized = 0;
-#if defined(_WIN32) && !defined(__MINGW32__)
+#if defined(_WIN32)
static CRITICAL_SECTION gaia_cache_semaphore;
#else
static pthread_mutex_t gaia_cache_semaphore = PTHREAD_MUTEX_INITIALIZER;
@@ -1262,7 +1262,7 @@
SPATIALITE_PRIVATE void
splite_cache_semaphore_lock (void)
{
-#if defined(_WIN32) && !defined(__MINGW32__)
+#if defined(_WIN32)
EnterCriticalSection (&gaia_cache_semaphore);
#else
pthread_mutex_lock (&gaia_cache_semaphore);
@@ -1272,7 +1272,7 @@
SPATIALITE_PRIVATE void
splite_cache_semaphore_unlock (void)
{
-#if defined(_WIN32) && !defined(__MINGW32__)
+#if defined(_WIN32)
LeaveCriticalSection (&gaia_cache_semaphore);
#else
pthread_mutex_trylock (&gaia_cache_semaphore);