summaryrefslogtreecommitdiffstats
path: root/gl/nl_langinfo-lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'gl/nl_langinfo-lock.c')
-rw-r--r--gl/nl_langinfo-lock.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/gl/nl_langinfo-lock.c b/gl/nl_langinfo-lock.c
index e5cdcd3..5a248ed 100644
--- a/gl/nl_langinfo-lock.c
+++ b/gl/nl_langinfo-lock.c
@@ -1,5 +1,5 @@
1/* Return the internal lock used by nl_langinfo. 1/* Return the internal lock used by nl_langinfo.
2 Copyright (C) 2019-2023 Free Software Foundation, Inc. 2 Copyright (C) 2019-2024 Free Software Foundation, Inc.
3 3
4 This file is free software: you can redistribute it and/or modify 4 This file is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as 5 it under the terms of the GNU Lesser General Public License as
@@ -18,9 +18,10 @@
18 18
19#include <config.h> 19#include <config.h>
20 20
21/* The option '--disable-threads' explicitly requests no locking. */
21/* When it is known that the gl_get_nl_langinfo_lock function is defined 22/* When it is known that the gl_get_nl_langinfo_lock function is defined
22 by a dependency library, it should not be defined here. */ 23 by a dependency library, it should not be defined here. */
23#if OMIT_NL_LANGINFO_LOCK 24#if AVOID_ANY_THREADS || OMIT_NL_LANGINFO_LOCK
24 25
25/* This declaration is solely to ensure that after preprocessing 26/* This declaration is solely to ensure that after preprocessing
26 this file is never empty. */ 27 this file is never empty. */
@@ -37,14 +38,14 @@ typedef int dummy;
37 38
38/* Macro for exporting a symbol (function, not variable) defined in this file, 39/* Macro for exporting a symbol (function, not variable) defined in this file,
39 when compiled into a shared library. */ 40 when compiled into a shared library. */
40# ifndef DLL_EXPORTED 41# ifndef SHLIB_EXPORTED
41# if HAVE_VISIBILITY 42# if HAVE_VISIBILITY
42 /* Override the effect of the compiler option '-fvisibility=hidden'. */ 43 /* Override the effect of the compiler option '-fvisibility=hidden'. */
43# define DLL_EXPORTED __attribute__((__visibility__("default"))) 44# define SHLIB_EXPORTED __attribute__((__visibility__("default")))
44# elif defined _WIN32 || defined __CYGWIN__ 45# elif defined _WIN32 || defined __CYGWIN__
45# define DLL_EXPORTED __declspec(dllexport) 46# define SHLIB_EXPORTED __declspec(dllexport)
46# else 47# else
47# define DLL_EXPORTED 48# define SHLIB_EXPORTED
48# endif 49# endif
49# endif 50# endif
50 51
@@ -59,7 +60,7 @@ typedef int dummy;
59 because the latter is not guaranteed to be a stable ABI in the future. */ 60 because the latter is not guaranteed to be a stable ABI in the future. */
60 61
61/* Make sure the function gets exported from DLLs. */ 62/* Make sure the function gets exported from DLLs. */
62DLL_EXPORTED CRITICAL_SECTION *gl_get_nl_langinfo_lock (void); 63SHLIB_EXPORTED CRITICAL_SECTION *gl_get_nl_langinfo_lock (void);
63 64
64static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT; 65static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT;
65static CRITICAL_SECTION lock; 66static CRITICAL_SECTION lock;
@@ -96,7 +97,7 @@ gl_get_nl_langinfo_lock (void)
96static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; 97static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
97 98
98/* Make sure the function gets exported from shared libraries. */ 99/* Make sure the function gets exported from shared libraries. */
99DLL_EXPORTED pthread_mutex_t *gl_get_nl_langinfo_lock (void); 100SHLIB_EXPORTED pthread_mutex_t *gl_get_nl_langinfo_lock (void);
100 101
101/* Returns the internal lock used by nl_langinfo. */ 102/* Returns the internal lock used by nl_langinfo. */
102pthread_mutex_t * 103pthread_mutex_t *
@@ -123,7 +124,7 @@ atomic_init (void)
123} 124}
124 125
125/* Make sure the function gets exported from shared libraries. */ 126/* Make sure the function gets exported from shared libraries. */
126DLL_EXPORTED mtx_t *gl_get_nl_langinfo_lock (void); 127SHLIB_EXPORTED mtx_t *gl_get_nl_langinfo_lock (void);
127 128
128/* Returns the internal lock used by nl_langinfo. */ 129/* Returns the internal lock used by nl_langinfo. */
129mtx_t * 130mtx_t *