summaryrefslogtreecommitdiff
path: root/lib/setlocale_null.c
Commit message (Collapse)AuthorAgeFilesLines
* setlocale-null: Don't use a lock in Cygwin >= 3.4.6.Bruno Haible2023-02-061-2/+2
| | | | | | | | | Road paved by Corinna Vinschen <vinschen@redhat.com>. * m4/setlocale_null.m4 (gl_FUNC_SETLOCALE_NULL): Assume that setlocale (LC_ALL, NULL) is multithread-safe in Cygwin >= 3.4.6. * lib/setlocale_null.c: Update comments. * tests/test-setlocale_null-mt-all.c: Likewise.
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* Put LGPLv2+ notices in source files where appropriate.Bruno Haible2021-06-041-7/+7
| | | | | * lib/**.{h,c,gperf}: Use LGPLv2+ notice whenever the module description says so.
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* setlocale-null: Add standalone include file.Bruno Haible2019-12-221-1/+2
| | | | | | | | | | | | * lib/setlocale_null.h: New file, extracted from lib/locale.in.h. * lib/locale.in.h: Include setlocale_null.h. (SETLOCALE_NULL_MAX, SETLOCALE_NULL_ALL_MAX, setlocale_null_r, setlocale_null): Remove declarations. * lib/setlocale_null.c: Include setlocale_null.h. * lib/localename.c: Likewise. * modules/setlocale-null (Files): Add lib/setlocale_null.h. (Depends-on): Add snippet/arg-nonnull. (Include): Allow either "setlocale_null.h" or <locale.h>.
* setlocale-null: Make API more useful.Bruno Haible2019-12-181-25/+146
| | | | | | | | | | | | | | | | * lib/locale.in.h (setlocale_null_r): Renamed from setlocale_null. All callers changed. (setlocale_null): New declaration. * lib/setlocale_null.c (setlocale_null_androidfix): New function, extracted from setlocale_null_unlocked. (setlocale_null_unlocked): Invoke it. (setlocale_null_r): Renamed from setlocale_null. (setlocale_null): New function, extracted from setlocale_mtsafe in setlocale.c. * lib/setlocale.c: Don't include <errno.h>. (setlocale_mtsafe): Invoke setlocale_null. * lib/setlocale-lock.c: Update comments. * doc/posix-functions/setlocale.texi: Mention both functions.
* setlocale-null: Handle NULL result from setlocale.Bruno Haible2019-12-181-27/+78
| | | | | | * lib/locale.in.h (setlocale_null): Document EINVAL return value. * lib/setlocale_null.c (setlocale_null_unlocked): Handle NULL result from setlocale or _wsetlocale.
* setlocale-null: Remove need for -lpthread on musl libc, *BSD, Haiku.Bruno Haible2019-12-161-10/+44
| | | | | | | | | | | | | | | | Reported by Arnold Robbins <arnold@skeeve.com>. * lib/setlocale_null.c (c11_threads_in_use, pthread_in_use): New macros, copied from lib/glthread/lock.h. (pthread_mutex_lock, pthread_mutex_unlock): Mark as weak. (setlocale_null_with_lock): If pthread_in_use() is false, use setlocale_null_unlocked directly. * m4/threadlib.m4 (gl_WEAK_SYMBOLS): New macro, extracted from gl_THREADLIB_BODY. Define HAVE_WEAK_SYMBOLS. (gl_THREADLIB_BODY): Invoke gl_WEAK_SYMBOLS. * m4/setlocale_null.m4 (gl_FUNC_SETLOCALE_NULL): Invoke gl_WEAK_SYMBOLS. Set LIB_SETLOCALE_NULL to empty if weak symbols are supported. * m4/duplocale.m4 (gl_FUNC_DUPLOCALE): Add comment.
* setlocale-null: New module.Bruno Haible2019-12-151-0/+204
* lib/locale.in.h (SETLOCALE_NULL_MAX, SETLOCALE_NULL_ALL_MAX, setlocale_null): New declarations. * lib/setlocale_null.c: New file. * lib/setlocale-lock.c: New file. * m4/threadlib.m4 (gl_PTHREADLIB_BODY): Define C macro HAVE_PTHREAD_API. * m4/setlocale_null.m4: New file. * m4/locale_h.m4 (gl_LOCALE_H_DEFAULTS): Initialize GNULIB_SETLOCALE_NULL. * modules/locale (Makefile.am): Substitute GNULIB_SETLOCALE_NULL. * modules/setlocale-null: New file. * doc/posix-functions/setlocale.texi: Mention the new module.