diff options
Diffstat (limited to 'gl/mbtowc-lock.c')
-rw-r--r-- | gl/mbtowc-lock.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gl/mbtowc-lock.c b/gl/mbtowc-lock.c index 6ca6e10..9001c5a 100644 --- a/gl/mbtowc-lock.c +++ b/gl/mbtowc-lock.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* Return the internal lock used by mbrtowc and mbrtoc32. | 1 | /* Return the internal lock used by mbrtowc and mbrtoc32. |
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_mbtowc_lock function is defined | 22 | /* When it is known that the gl_get_mbtowc_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_MBTOWC_LOCK | 24 | #if AVOID_ANY_THREADS || OMIT_MBTOWC_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. */ |
62 | DLL_EXPORTED CRITICAL_SECTION *gl_get_mbtowc_lock (void); | 63 | SHLIB_EXPORTED CRITICAL_SECTION *gl_get_mbtowc_lock (void); |
63 | 64 | ||
64 | static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT; | 65 | static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT; |
65 | static CRITICAL_SECTION lock; | 66 | static CRITICAL_SECTION lock; |
@@ -96,7 +97,7 @@ gl_get_mbtowc_lock (void) | |||
96 | static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; | 97 | static 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. */ |
99 | DLL_EXPORTED pthread_mutex_t *gl_get_mbtowc_lock (void); | 100 | SHLIB_EXPORTED pthread_mutex_t *gl_get_mbtowc_lock (void); |
100 | 101 | ||
101 | /* Returns the internal lock used by mbrtowc and mbrtoc32. */ | 102 | /* Returns the internal lock used by mbrtowc and mbrtoc32. */ |
102 | pthread_mutex_t * | 103 | pthread_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. */ |
126 | DLL_EXPORTED mtx_t *gl_get_mbtowc_lock (void); | 127 | SHLIB_EXPORTED mtx_t *gl_get_mbtowc_lock (void); |
127 | 128 | ||
128 | /* Returns the internal lock used by mbrtowc and mbrtoc32. */ | 129 | /* Returns the internal lock used by mbrtowc and mbrtoc32. */ |
129 | mtx_t * | 130 | mtx_t * |