]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
localename-unsafe: respect --disable-threads
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 26 Apr 2026 22:09:00 +0000 (15:09 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 26 Apr 2026 22:10:44 +0000 (15:10 -0700)
Respect --disable-threads on native MS-Windows.
* lib/localename-unsafe.c (GLWTHREAD_MUTEX_INIT, glwthread_mutex_t)
(glwthread_mutex_lock, glwthread_mutex_unlock)
[AVOID_ANY_THREADS && _WIN32 && !__CYGWIN]:
Instead of including "windows-mutex.h", provide no-op substitutes
for its symbols used here.

ChangeLog
lib/localename-unsafe.c

index 454b9983ad711e98634bba73aa521e645db50d33..72b45b1eb4b1a79afad753a1a2f4406e1cc1ac02 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2026-04-26  Paul Eggert  <eggert@cs.ucla.edu>
+
+       localename-unsafe: respect --disable-threads
+       Respect --disable-threads on native MS-Windows.
+       * lib/localename-unsafe.c (GLWTHREAD_MUTEX_INIT, glwthread_mutex_t)
+       (glwthread_mutex_lock, glwthread_mutex_unlock)
+       [AVOID_ANY_THREADS && _WIN32 && !__CYGWIN]:
+       Instead of including "windows-mutex.h", provide no-op substitutes
+       for its symbols used here.
+
 2026-04-25  Paul Eggert  <eggert@cs.ucla.edu>
 
        c-strtod-tests: port to single-threaded builds
index d490fe89bee4501925f8f880c11ea7df24267b88..137d551edb858080eec4220fbdd889d27dbb67c7 100644 (file)
 # define WINDOWS_NATIVE
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
-# include "windows-mutex.h"
+/* The option '--disable-threads' explicitly requests no locking.  */
+# if AVOID_ANY_THREADS
+typedef enum { GLWTHREAD_MUTEX_INIT } glwthread_mutex_t;
+static int glwthread_mutex_lock (glwthread_mutex_t *m) { return 0; }
+static int glwthread_mutex_unlock (glwthread_mutex_t *m) { return 0; }
+# else
+#  include "windows-mutex.h"
+# endif
 #endif
 
 #if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */