summaryrefslogtreecommitdiffstats
path: root/gl/lib/setlocale_null.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:38:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:38:57 +0000
commitf5b6b735a731901f09d7f3cc153c1d869269ee83 (patch)
tree565a1b0f3c6a4094a5f2198879fb239053549f1e /gl/lib/setlocale_null.c
parentAdding upstream version 2.12.0. (diff)
downloadman-db-upstream.tar.xz
man-db-upstream.zip
Adding upstream version 2.12.1.upstream/2.12.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gl/lib/setlocale_null.c')
-rw-r--r--gl/lib/setlocale_null.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gl/lib/setlocale_null.c b/gl/lib/setlocale_null.c
index 89c8a06..697502f 100644
--- a/gl/lib/setlocale_null.c
+++ b/gl/lib/setlocale_null.c
@@ -1,5 +1,5 @@
/* Query the name of the current global locale.
- Copyright (C) 2019-2023 Free Software Foundation, Inc.
+ Copyright (C) 2019-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -30,7 +30,12 @@
#endif
#if !(SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE)
-# if defined _WIN32 && !defined __CYGWIN__
+
+# if AVOID_ANY_THREADS
+
+/* The option '--disable-threads' explicitly requests no locking. */
+
+# elif defined _WIN32 && !defined __CYGWIN__
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
# include <windows.h>
@@ -51,6 +56,7 @@
# include <threads.h>
# endif
+
#endif
/* Use the system's setlocale() function, not the gnulib override, here. */
@@ -181,7 +187,12 @@ setlocale_null_unlocked (int category, char *buf, size_t bufsize)
/* Prohibit renaming this symbol. */
# undef gl_get_setlocale_null_lock
-# if defined _WIN32 && !defined __CYGWIN__
+# if AVOID_ANY_THREADS
+
+/* The option '--disable-threads' explicitly requests no locking. */
+# define setlocale_null_with_lock setlocale_null_unlocked
+
+# elif defined _WIN32 && !defined __CYGWIN__
extern __declspec(dllimport) CRITICAL_SECTION *gl_get_setlocale_null_lock (void);