* lib/mbtowc-lock.c: New file, based on lib/setlocale-lock.c.
* lib/mbtowc-lock.h: New file, extracted from lib/mbrtowc.c and
lib/setlocale_null.c.
* lib/mbrtowc.c: Include headers needed for mbtowc-lock.h. Don't include
glthread/lock.h. Include mbtowc-lock.h.
(mbtowc_lock): Remove declaration.
(mbrtowc): Use mbtowc_with_lock.
* m4/mbrtowc.m4 (gl_FUNC_MBRTOWC): Require gl_PTHREADLIB. Check for
threads.h. Set LIB_MBRTOWC.
(gl_PREREQ_MBTOWC_LOCK): New macro.
* modules/mbrtowc (Files): Add lib/mbtowc-lock.h, lib/mbtowc-lock.c,
lib/windows-initguard.h, m4/threadlib.m4, m4/visibility.m4.
(Depends-on): Remove lock.
(configure.ac): Arrange to compile mbtowc-lock.c.
(Link): Mention $(LIB_MBRTOWC) instead of $(LIBTHREAD).
* modules/acl (Link): Likewise.
* modules/argmatch (Link): Likewise.
* modules/backup-rename (Link): Likewise.
* modules/backupfile (Link): Likewise.
* modules/closein (Link): Likewise.
* modules/closeout (Link): Likewise.
* modules/copy-file (Link): Likewise.
* modules/csharpcomp (Link): Likewise.
* modules/csharpexec (Link): Likewise.
* modules/dfa (Link): Likewise.
* modules/exclude (Link): Likewise.
* modules/fnmatch (Link): Likewise.
* modules/fnmatch-gnu (Link): Likewise.
* modules/fnmatch-posix (Link): Likewise.
* modules/glob (Link): Likewise.
* modules/human (Link): Likewise.
* modules/javacomp (Link): Likewise.
* modules/javaexec (Link): Likewise.
* modules/javaversion (Link): Likewise.
* modules/mbfile (Link): Likewise.
* modules/mbiter (Link): Likewise.
* modules/mbmemcasecmp (Link): Likewise.
* modules/mbmemcasecoll (Link): Likewise.
* modules/mbrlen (Link): Likewise.
* modules/mbscasecmp (Link): Likewise.
* modules/mbscasestr (Link): Likewise.
* modules/mbschr (Link): Likewise.
* modules/mbscspn (Link): Likewise.
* modules/mbsinit (Link): Likewise.
* modules/mbslen (Link): Likewise.
* modules/mbsncasecmp (Link): Likewise.
* modules/mbsnlen (Link): Likewise.
* modules/mbsnrtowcs (Link): Likewise.
* modules/mbspbrk (Link): Likewise.
* modules/mbspcasecmp (Link): Likewise.
* modules/mbsrchr (Link): Likewise.
* modules/mbsrtowcs (Link): Likewise.
* modules/mbssep (Link): Likewise.
* modules/mbsspn (Link): Likewise.
* modules/mbsstr (Link): Likewise.
* modules/mbstok_r (Link): Likewise.
* modules/mbswidth (Link): Likewise.
* modules/mbuiter (Link): Likewise.
* modules/mkdir-p (Link): Likewise.
* modules/propername (Link): Likewise.
* modules/quote (Link): Likewise.
* modules/quotearg (Link): Likewise.
* modules/quotearg-simple (Link): Likewise.
* modules/regex-quote (Link): Likewise.
* modules/rpmatch (Link): Likewise.
* modules/sh-quote (Link): Likewise.
* modules/system-quote (Link): Likewise.
* modules/trim (Link): Likewise.
* modules/unistdio/ulc-asnprintf (Link): Likewise.
* modules/unistdio/ulc-fprintf (Link): Likewise.
* modules/unistdio/ulc-vasnprintf (Link): Likewise.
* modules/unistdio/ulc-vasprintf (Link): Likewise.
* modules/unistdio/ulc-vfprintf (Link): Likewise.
* modules/unistdio/ulc-vsnprintf (Link): Likewise.
* modules/unistdio/ulc-vsprintf (Link): Likewise.
* modules/xfreopen (Link): Likewise.
* modules/xmemcoll (Link): Likewise.
* modules/yesno (Link): Likewise.
* modules/regex (Link): Add $(LIB_MBRTOWC).
* modules/acl-tests (Makefile.am): Link the programs with $(LIB_MBRTOWC)
instead of $(LIBTHREAD).
* modules/argmatch-tests (Makefile.am): Likewise.
* modules/closein-tests (Makefile.am): Likewise.
* modules/copy-file-tests (Makefile.am): Likewise.
* modules/dfa-tests (Makefile.am): Likewise.
* modules/fnmatch-tests (Makefile.am): Likewise.
* modules/glob-tests (Makefile.am): Likewise.
* modules/mbmemcasecmp-tests (Makefile.am): Likewise.
* modules/mbmemcasecoll-tests (Makefile.am): Likewise.
* modules/mbrtowc-tests (Makefile.am): Likewise.
* modules/mbscasecmp-tests (Makefile.am): Likewise.
* modules/mbscasestr-tests (Makefile.am): Likewise.
* modules/mbschr-tests (Makefile.am): Likewise.
* modules/mbscspn-tests (Makefile.am): Likewise.
* modules/mbsinit-tests (Makefile.am): Likewise.
* modules/mbsncasecmp-tests (Makefile.am): Likewise.
* modules/mbsnrtowcs-tests (Makefile.am): Likewise.
* modules/mbspbrk-tests (Makefile.am): Likewise.
* modules/mbspcasecmp-tests (Makefile.am): Likewise.
* modules/mbsrchr-tests (Makefile.am): Likewise.
* modules/mbsrtowcs-tests (Makefile.am): Likewise.
* modules/mbsspn-tests (Makefile.am): Likewise.
* modules/mbsstr-tests (Makefile.am): Likewise.
* modules/quotearg-simple-tests (Makefile.am): Likewise.
* modules/quotearg-tests (Makefile.am): Likewise.
* modules/readtokens-tests (Makefile.am): Likewise.
* modules/sh-quote-tests (Makefile.am): Likewise.
* modules/system-quote-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-asnprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vasnprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vasprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vsnprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vsprintf-tests (Makefile.am): Likewise.
* modules/yesno-tests (Makefile.am): Likewise.
* modules/exclude-tests (Makefile.am): Link the programs with
$(LIB_MBRTOWC).
* modules/regex-tests (Makefile.am): Likewise.
* modules/regex-quote-tests (Makefile.am): Likewise.
+2020-01-03 Bruno Haible <bruno@clisp.org>
+
+ mbrtowc: Ensure the mbtowc_lock is unique.
+ * lib/mbtowc-lock.c: New file, based on lib/setlocale-lock.c.
+ * lib/mbtowc-lock.h: New file, extracted from lib/mbrtowc.c and
+ lib/setlocale_null.c.
+ * lib/mbrtowc.c: Include headers needed for mbtowc-lock.h. Don't include
+ glthread/lock.h. Include mbtowc-lock.h.
+ (mbtowc_lock): Remove declaration.
+ (mbrtowc): Use mbtowc_with_lock.
+ * m4/mbrtowc.m4 (gl_FUNC_MBRTOWC): Require gl_PTHREADLIB. Check for
+ threads.h. Set LIB_MBRTOWC.
+ (gl_PREREQ_MBTOWC_LOCK): New macro.
+ * modules/mbrtowc (Files): Add lib/mbtowc-lock.h, lib/mbtowc-lock.c,
+ lib/windows-initguard.h, m4/threadlib.m4, m4/visibility.m4.
+ (Depends-on): Remove lock.
+ (configure.ac): Arrange to compile mbtowc-lock.c.
+ (Link): Mention $(LIB_MBRTOWC) instead of $(LIBTHREAD).
+ * modules/acl (Link): Likewise.
+ * modules/argmatch (Link): Likewise.
+ * modules/backup-rename (Link): Likewise.
+ * modules/backupfile (Link): Likewise.
+ * modules/closein (Link): Likewise.
+ * modules/closeout (Link): Likewise.
+ * modules/copy-file (Link): Likewise.
+ * modules/csharpcomp (Link): Likewise.
+ * modules/csharpexec (Link): Likewise.
+ * modules/dfa (Link): Likewise.
+ * modules/exclude (Link): Likewise.
+ * modules/fnmatch (Link): Likewise.
+ * modules/fnmatch-gnu (Link): Likewise.
+ * modules/fnmatch-posix (Link): Likewise.
+ * modules/glob (Link): Likewise.
+ * modules/human (Link): Likewise.
+ * modules/javacomp (Link): Likewise.
+ * modules/javaexec (Link): Likewise.
+ * modules/javaversion (Link): Likewise.
+ * modules/mbfile (Link): Likewise.
+ * modules/mbiter (Link): Likewise.
+ * modules/mbmemcasecmp (Link): Likewise.
+ * modules/mbmemcasecoll (Link): Likewise.
+ * modules/mbrlen (Link): Likewise.
+ * modules/mbscasecmp (Link): Likewise.
+ * modules/mbscasestr (Link): Likewise.
+ * modules/mbschr (Link): Likewise.
+ * modules/mbscspn (Link): Likewise.
+ * modules/mbsinit (Link): Likewise.
+ * modules/mbslen (Link): Likewise.
+ * modules/mbsncasecmp (Link): Likewise.
+ * modules/mbsnlen (Link): Likewise.
+ * modules/mbsnrtowcs (Link): Likewise.
+ * modules/mbspbrk (Link): Likewise.
+ * modules/mbspcasecmp (Link): Likewise.
+ * modules/mbsrchr (Link): Likewise.
+ * modules/mbsrtowcs (Link): Likewise.
+ * modules/mbssep (Link): Likewise.
+ * modules/mbsspn (Link): Likewise.
+ * modules/mbsstr (Link): Likewise.
+ * modules/mbstok_r (Link): Likewise.
+ * modules/mbswidth (Link): Likewise.
+ * modules/mbuiter (Link): Likewise.
+ * modules/mkdir-p (Link): Likewise.
+ * modules/propername (Link): Likewise.
+ * modules/quote (Link): Likewise.
+ * modules/quotearg (Link): Likewise.
+ * modules/quotearg-simple (Link): Likewise.
+ * modules/regex-quote (Link): Likewise.
+ * modules/rpmatch (Link): Likewise.
+ * modules/sh-quote (Link): Likewise.
+ * modules/system-quote (Link): Likewise.
+ * modules/trim (Link): Likewise.
+ * modules/unistdio/ulc-asnprintf (Link): Likewise.
+ * modules/unistdio/ulc-fprintf (Link): Likewise.
+ * modules/unistdio/ulc-vasnprintf (Link): Likewise.
+ * modules/unistdio/ulc-vasprintf (Link): Likewise.
+ * modules/unistdio/ulc-vfprintf (Link): Likewise.
+ * modules/unistdio/ulc-vsnprintf (Link): Likewise.
+ * modules/unistdio/ulc-vsprintf (Link): Likewise.
+ * modules/xfreopen (Link): Likewise.
+ * modules/xmemcoll (Link): Likewise.
+ * modules/yesno (Link): Likewise.
+ * modules/regex (Link): Add $(LIB_MBRTOWC).
+ * modules/acl-tests (Makefile.am): Link the programs with $(LIB_MBRTOWC)
+ instead of $(LIBTHREAD).
+ * modules/argmatch-tests (Makefile.am): Likewise.
+ * modules/closein-tests (Makefile.am): Likewise.
+ * modules/copy-file-tests (Makefile.am): Likewise.
+ * modules/dfa-tests (Makefile.am): Likewise.
+ * modules/fnmatch-tests (Makefile.am): Likewise.
+ * modules/glob-tests (Makefile.am): Likewise.
+ * modules/mbmemcasecmp-tests (Makefile.am): Likewise.
+ * modules/mbmemcasecoll-tests (Makefile.am): Likewise.
+ * modules/mbrtowc-tests (Makefile.am): Likewise.
+ * modules/mbscasecmp-tests (Makefile.am): Likewise.
+ * modules/mbscasestr-tests (Makefile.am): Likewise.
+ * modules/mbschr-tests (Makefile.am): Likewise.
+ * modules/mbscspn-tests (Makefile.am): Likewise.
+ * modules/mbsinit-tests (Makefile.am): Likewise.
+ * modules/mbsncasecmp-tests (Makefile.am): Likewise.
+ * modules/mbsnrtowcs-tests (Makefile.am): Likewise.
+ * modules/mbspbrk-tests (Makefile.am): Likewise.
+ * modules/mbspcasecmp-tests (Makefile.am): Likewise.
+ * modules/mbsrchr-tests (Makefile.am): Likewise.
+ * modules/mbsrtowcs-tests (Makefile.am): Likewise.
+ * modules/mbsspn-tests (Makefile.am): Likewise.
+ * modules/mbsstr-tests (Makefile.am): Likewise.
+ * modules/quotearg-simple-tests (Makefile.am): Likewise.
+ * modules/quotearg-tests (Makefile.am): Likewise.
+ * modules/readtokens-tests (Makefile.am): Likewise.
+ * modules/sh-quote-tests (Makefile.am): Likewise.
+ * modules/system-quote-tests (Makefile.am): Likewise.
+ * modules/unistdio/ulc-asnprintf-tests (Makefile.am): Likewise.
+ * modules/unistdio/ulc-vasnprintf-tests (Makefile.am): Likewise.
+ * modules/unistdio/ulc-vasprintf-tests (Makefile.am): Likewise.
+ * modules/unistdio/ulc-vsnprintf-tests (Makefile.am): Likewise.
+ * modules/unistdio/ulc-vsprintf-tests (Makefile.am): Likewise.
+ * modules/yesno-tests (Makefile.am): Likewise.
+ * modules/exclude-tests (Makefile.am): Link the programs with
+ $(LIB_MBRTOWC).
+ * modules/regex-tests (Makefile.am): Likewise.
+ * modules/regex-quote-tests (Makefile.am): Likewise.
+
2020-01-03 Bruno Haible <bruno@clisp.org>
getopt-posix: Fix compilation failure in testdirs.
# include <stdint.h>
# include <stdlib.h>
+# if defined _WIN32 && !defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# elif HAVE_PTHREAD_API
+
+# include <pthread.h>
+# if HAVE_THREADS_H && HAVE_WEAK_SYMBOLS
+# include <threads.h>
+# pragma weak thrd_exit
+# define c11_threads_in_use() (thrd_exit != NULL)
+# else
+# define c11_threads_in_use() 0
+# endif
+
+# elif HAVE_THREADS_H
+
+# include <threads.h>
+
+# endif
+
# include "localcharset.h"
# include "streq.h"
# include "verify.h"
-# include "glthread/lock.h"
+# include "mbtowc-lock.h"
# ifndef FALLTHROUGH
# if __GNUC__ < 7
# define locale_enc_cached locale_enc
# endif
-/* This lock protects the internal state of mbtowc against multiple simultaneous
- calls of mbrtowc. */
-gl_lock_define_initialized(static, mbtowc_lock)
-
verify (sizeof (mbstate_t) >= 4);
-
static char internal_state[4];
size_t
{
/* The hidden internal state of mbtowc would make this function not
multi-thread safe. Achieve multi-thread safety through a lock. */
- gl_lock_lock (mbtowc_lock);
-
- /* Put the hidden internal state of mbtowc into its initial state.
- This is needed at least with glibc, uClibc, and MSVC CRT.
- See <https://sourceware.org/bugzilla/show_bug.cgi?id=9674>. */
- mbtowc (NULL, NULL, 0);
-
- res = mbtowc (pwc, p, m);
-
- gl_lock_unlock (mbtowc_lock);
+ res = mbtowc_with_lock (pwc, p, m);
if (res >= 0)
{
--- /dev/null
+/* Return the internal lock used by mbrtowc and mbrtoc32.
+ Copyright (C) 2019-2020 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019-2020. */
+
+#include <config.h>
+
+/* When it is known that the gl_get_mbtowc_lock function is defined
+ by a dependency library, it should not be defined here. */
+#if OMIT_MBTOWC_LOCK
+
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
+
+#else
+
+/* This file defines the internal lock used by mbrtowc and mbrtoc32.
+ It is a separate compilation unit, so that only one copy of it is
+ present when linking statically. */
+
+/* Prohibit renaming this symbol. */
+# undef gl_get_mbtowc_lock
+
+/* Macro for exporting a symbol (function, not variable) defined in this file,
+ when compiled into a shared library. */
+# ifndef DLL_EXPORTED
+# if HAVE_VISIBILITY
+ /* Override the effect of the compiler option '-fvisibility=hidden'. */
+# define DLL_EXPORTED __attribute__((__visibility__("default")))
+# elif defined _WIN32 || defined __CYGWIN__
+# define DLL_EXPORTED __declspec(dllexport)
+# else
+# define DLL_EXPORTED
+# endif
+# endif
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# include "windows-initguard.h"
+
+/* The return type is a 'CRITICAL_SECTION *', not a 'glwthread_mutex_t *',
+ because the latter is not guaranteed to be a stable ABI in the future. */
+
+/* Make sure the function gets exported from DLLs. */
+DLL_EXPORTED CRITICAL_SECTION *gl_get_mbtowc_lock (void);
+
+static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT;
+static CRITICAL_SECTION lock;
+
+/* Returns the internal lock used by mbrtowc and mbrtoc32. */
+CRITICAL_SECTION *
+gl_get_mbtowc_lock (void)
+{
+ if (!guard.done)
+ {
+ if (InterlockedIncrement (&guard.started) == 0)
+ {
+ /* This thread is the first one to need the lock. Initialize it. */
+ InitializeCriticalSection (&lock);
+ guard.done = 1;
+ }
+ else
+ {
+ /* Don't let guard.started grow and wrap around. */
+ InterlockedDecrement (&guard.started);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this mutex. */
+ while (!guard.done)
+ Sleep (0);
+ }
+ }
+ return &lock;
+}
+
+# elif HAVE_PTHREAD_API
+
+# include <pthread.h>
+
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+/* Make sure the function gets exported from shared libraries. */
+DLL_EXPORTED pthread_mutex_t *gl_get_mbtowc_lock (void);
+
+/* Returns the internal lock used by mbrtowc and mbrtoc32. */
+pthread_mutex_t *
+gl_get_mbtowc_lock (void)
+{
+ return &mutex;
+}
+
+# elif HAVE_THREADS_H
+
+# include <threads.h>
+# include <stdlib.h>
+
+static int volatile init_needed = 1;
+static once_flag init_once = ONCE_FLAG_INIT;
+static mtx_t mutex;
+
+static void
+atomic_init (void)
+{
+ if (mtx_init (&mutex, mtx_plain) != thrd_success)
+ abort ();
+ init_needed = 0;
+}
+
+/* Make sure the function gets exported from shared libraries. */
+DLL_EXPORTED mtx_t *gl_get_mbtowc_lock (void);
+
+/* Returns the internal lock used by mbrtowc and mbrtoc32. */
+mtx_t *
+gl_get_mbtowc_lock (void)
+{
+ if (init_needed)
+ call_once (&init_once, atomic_init);
+ return &mutex;
+}
+
+# endif
+
+# if (defined _WIN32 || defined __CYGWIN__) && !defined _MSC_VER
+/* Make sure the '__declspec(dllimport)' in mbrtowc.c and mbrtoc32.c does not
+ cause a link failure when no DLLs are involved. */
+# if defined _WIN64 || defined _LP64
+# define IMP(x) __imp_##x
+# else
+# define IMP(x) _imp__##x
+# endif
+void * IMP(gl_get_mbtowc_lock) = &gl_get_mbtowc_lock;
+# endif
+
+#endif
--- /dev/null
+/* Use the internal lock used by mbrtowc and mbrtoc32.
+ Copyright (C) 2019-2020 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019-2020. */
+
+/* Use a lock, so that no two threads can invoke mbtowc at the same time. */
+
+static inline int
+mbtowc_unlocked (wchar_t *pwc, const char *p, size_t m)
+{
+ /* Put the hidden internal state of mbtowc into its initial state.
+ This is needed at least with glibc, uClibc, and MSVC CRT.
+ See <https://sourceware.org/bugzilla/show_bug.cgi?id=9674>. */
+ mbtowc (NULL, NULL, 0);
+
+ return mbtowc (pwc, p, m);
+}
+
+/* Prohibit renaming this symbol. */
+#undef gl_get_mbtowc_lock
+
+#if defined _WIN32 && !defined __CYGWIN__
+
+extern __declspec(dllimport) CRITICAL_SECTION *gl_get_mbtowc_lock (void);
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+ CRITICAL_SECTION *lock = gl_get_mbtowc_lock ();
+ int ret;
+
+ EnterCriticalSection (lock);
+ ret = mbtowc_unlocked (pwc, p, m);
+ LeaveCriticalSection (lock);
+
+ return ret;
+}
+
+#elif HAVE_PTHREAD_API /* AIX, IRIX, Cygwin */
+
+extern
+# if defined _WIN32 || defined __CYGWIN__
+ __declspec(dllimport)
+# endif
+ pthread_mutex_t *gl_get_mbtowc_lock (void);
+
+# if HAVE_WEAK_SYMBOLS /* IRIX */
+
+ /* Avoid the need to link with '-lpthread'. */
+# pragma weak pthread_mutex_lock
+# pragma weak pthread_mutex_unlock
+
+ /* Determine whether libpthread is in use. */
+# pragma weak pthread_mutexattr_gettype
+ /* See the comments in lock.h. */
+# define pthread_in_use() \
+ (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
+
+# else
+# define pthread_in_use() 1
+# endif
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+ if (pthread_in_use())
+ {
+ pthread_mutex_t *lock = gl_get_mbtowc_lock ();
+ int ret;
+
+ if (pthread_mutex_lock (lock))
+ abort ();
+ ret = mbtowc_unlocked (pwc, p, m);
+ if (pthread_mutex_unlock (lock))
+ abort ();
+
+ return ret;
+ }
+ else
+ return mbtowc_unlocked (pwc, p, m);
+}
+
+#elif HAVE_THREADS_H
+
+extern mtx_t *gl_get_mbtowc_lock (void);
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+ mtx_t *lock = gl_get_mbtowc_lock ();
+ int ret;
+
+ if (mtx_lock (lock) != thrd_success)
+ abort ();
+ ret = mbtowc_unlocked (pwc, p, m);
+ if (mtx_unlock (lock) != thrd_success)
+ abort ();
+
+ return ret;
+}
+
+#endif
-# mbrtowc.m4 serial 36 -*- coding: utf-8 -*-
+# mbrtowc.m4 serial 37 -*- coding: utf-8 -*-
dnl Copyright (C) 2001-2002, 2004-2005, 2008-2020 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
AC_DEFUN([gl_FUNC_MBRTOWC],
[
AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_REQUIRE([gl_PTHREADLIB])
+ AC_CHECK_HEADERS_ONCE([threads.h])
AC_REQUIRE([AC_TYPE_MBSTATE_T])
gl_MBSTATE_T_BROKEN
esac
fi
fi
+ if test $REPLACE_MBSTATE_T = 1; then
+ case "$host_os" in
+ mingw*) LIB_MBRTOWC= ;;
+ *)
+ gl_WEAK_SYMBOLS
+ case "$gl_cv_have_weak" in
+ *yes) LIB_MBRTOWC= ;;
+ *) LIB_MBRTOWC="$LIBPTHREAD" ;;
+ esac
+ ;;
+ esac
+ else
+ LIB_MBRTOWC=
+ fi
+ dnl LIB_MBRTOWC is expected to be '-pthread' or '-lpthread' on AIX
+ dnl with gcc or xlc, and empty otherwise.
+ AC_SUBST([LIB_MBRTOWC])
])
dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that
:
])
+# Prerequisites of lib/mbtowc-lock.c.
+AC_DEFUN([gl_PREREQ_MBTOWC_LOCK],
+[
+ gl_VISIBILITY
+])
+
dnl From Paul Eggert
"acl.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
test-copy-acl.sh test-copy-acl-1.sh test-copy-acl-2.sh
TESTS_ENVIRONMENT += USE_ACL=$(USE_ACL)
check_PROGRAMS += test-set-mode-acl test-copy-acl test-sameacls
-test_set_mode_acl_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ $(LIBTHREAD)
-test_copy_acl_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ $(LIBTHREAD)
-test_sameacls_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ $(LIBTHREAD)
+test_set_mode_acl_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ $(LIB_MBRTOWC)
+test_copy_acl_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ $(LIB_MBRTOWC)
+test_sameacls_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ $(LIB_MBRTOWC)
"argmatch.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
Makefile.am:
TESTS += test-argmatch
check_PROGRAMS += test-argmatch
-test_argmatch_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_argmatch_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC)
"backupfile.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"backupfile.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"closein.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
Makefile.am:
TESTS += test-closein.sh
check_PROGRAMS += test-closein
-test_closein_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_closein_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC)
"closeout.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"copy-file.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
TESTS += test-copy-file.sh test-copy-file-1.sh test-copy-file-2.sh
TESTS_ENVIRONMENT += USE_ACL=$(USE_ACL)
check_PROGRAMS += test-copy-file
-test_copy_file_LDADD = $(LDADD) $(LIB_ACL) $(LIB_CLOCK_GETTIME) @LIBINTL@ $(LIBTHREAD)
+test_copy_file_LDADD = $(LDADD) $(LIB_ACL) $(LIB_CLOCK_GETTIME) @LIBINTL@ $(LIB_MBRTOWC)
"csharpcomp.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"csharpexec.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"localeinfo.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
dfa-match.sh
check_PROGRAMS += dfa-match-aux
-dfa_match_aux_LDADD = $(LDADD) $(LIB_SETLOCALE) @LIBINTL@ $(LIBTHREAD)
+dfa_match_aux_LDADD = $(LDADD) $(LIB_SETLOCALE) @LIBINTL@ $(LIB_MBRTOWC)
"exclude.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
test-exclude8.sh
check_PROGRAMS += test-exclude
-test_exclude_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_exclude_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC) $(LIBTHREAD)
<fnmatch.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv2+
<fnmatch.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv2+
"fnmatch.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv2+
Makefile.am:
TESTS += test-fnmatch
check_PROGRAMS += test-fnmatch
-test_fnmatch_LDADD = $(LDADD) $(LIBTHREAD)
+test_fnmatch_LDADD = $(LDADD) $(LIB_MBRTOWC)
<glob.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv2+
Makefile.am:
TESTS += test-glob
check_PROGRAMS += test-glob
-test_glob_LDADD = $(LDADD) $(LIBTHREAD)
+test_glob_LDADD = $(LDADD) $(LIB_MBRTOWC)
"human.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"javacomp.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"javaexec.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"javaversion.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"mbfile.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
"mbiter.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv2+
"mbmemcasecmp.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
LOCALE_TR_UTF8='@LOCALE_TR_UTF8@'
check_PROGRAMS += test-mbmemcasecmp
-test_mbmemcasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbmemcasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
"mbmemcasecoll.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
LOCALE_TR_UTF8='@LOCALE_TR_UTF8@'
check_PROGRAMS += test-mbmemcasecoll
-test_mbmemcasecoll_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbmemcasecoll_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
<wchar.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
Files:
lib/mbrtowc.c
+lib/mbtowc-lock.h
+lib/mbtowc-lock.c
+lib/windows-initguard.h
m4/mbrtowc.m4
m4/mbstate_t.m4
m4/locale-fr.m4
m4/locale-ja.m4
m4/locale-zh.m4
m4/codeset.m4
+m4/threadlib.m4
+m4/visibility.m4
Depends-on:
wchar
localcharset [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
streq [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
verify [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
-lock [test $HAVE_MBRTOWC = 0 || { test $REPLACE_MBRTOWC = 1 && { test $HAVE_MBSINIT = 0 || test $REPLACE_MBSTATE_T = 1; }; }]
configure.ac:
gl_FUNC_MBRTOWC
if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
AC_LIBOBJ([mbrtowc])
+ AC_LIBOBJ([mbtowc-lock])
gl_PREREQ_MBRTOWC
+ gl_PREREQ_MBTOWC_LOCK
fi
gl_WCHAR_MODULE_INDICATOR([mbrtowc])
<wchar.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv2+
LOCALE_JA='@LOCALE_JA@' \
LOCALE_ZH_CN='@LOCALE_ZH_CN@'
check_PROGRAMS += test-mbrtowc test-mbrtowc-w32
-test_mbrtowc_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbrtowc_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
<string.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
TESTS += test-mbscasecmp.sh
TESTS_ENVIRONMENT += LOCALE_TR_UTF8='@LOCALE_TR_UTF8@'
check_PROGRAMS += test-mbscasecmp
-test_mbscasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbscasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
<string.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
TESTS += test-mbscasestr1 test-mbscasestr2.sh test-mbscasestr3.sh test-mbscasestr4.sh
TESTS_ENVIRONMENT += LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_TR_UTF8='@LOCALE_TR_UTF8@' LOCALE_ZH_CN='@LOCALE_ZH_CN@'
check_PROGRAMS += test-mbscasestr1 test-mbscasestr2 test-mbscasestr3 test-mbscasestr4
-test_mbscasestr1_LDADD = $(LDADD) $(LIBTHREAD)
-test_mbscasestr2_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
-test_mbscasestr3_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
-test_mbscasestr4_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbscasestr1_LDADD = $(LDADD) $(LIB_MBRTOWC)
+test_mbscasestr2_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
+test_mbscasestr3_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
+test_mbscasestr4_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
<string.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
TESTS += test-mbschr.sh
TESTS_ENVIRONMENT += LOCALE_ZH_CN='@LOCALE_ZH_CN@'
check_PROGRAMS += test-mbschr
-test_mbschr_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbschr_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
<string.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
TESTS += test-mbscspn.sh
TESTS_ENVIRONMENT += LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
check_PROGRAMS += test-mbscspn
-test_mbscspn_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbscspn_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
<wchar.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv2+
TESTS += test-mbsinit.sh
TESTS_ENVIRONMENT += LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
check_PROGRAMS += test-mbsinit
-test_mbsinit_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbsinit_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
<string.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
<string.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
TESTS += test-mbsncasecmp.sh
TESTS_ENVIRONMENT += LOCALE_TR_UTF8='@LOCALE_TR_UTF8@'
check_PROGRAMS += test-mbsncasecmp
-test_mbsncasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbsncasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
<string.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv2+
<wchar.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
LOCALE_JA='@LOCALE_JA@' \
LOCALE_ZH_CN='@LOCALE_ZH_CN@'
check_PROGRAMS += test-mbsnrtowcs
-test_mbsnrtowcs_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbsnrtowcs_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
<string.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
TESTS += test-mbspbrk.sh
TESTS_ENVIRONMENT += LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
check_PROGRAMS += test-mbspbrk
-test_mbspbrk_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbspbrk_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
<string.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
TESTS += test-mbspcasecmp.sh
TESTS_ENVIRONMENT += LOCALE_TR_UTF8='@LOCALE_TR_UTF8@'
check_PROGRAMS += test-mbspcasecmp
-test_mbspcasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbspcasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
<string.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
TESTS += test-mbsrchr.sh
TESTS_ENVIRONMENT += LOCALE_ZH_CN='@LOCALE_ZH_CN@'
check_PROGRAMS += test-mbsrchr
-test_mbsrchr_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbsrchr_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
<wchar.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv2+
LOCALE_JA='@LOCALE_JA@' \
LOCALE_ZH_CN='@LOCALE_ZH_CN@'
check_PROGRAMS += test-mbsrtowcs
-test_mbsrtowcs_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbsrtowcs_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
<string.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
<string.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
TESTS += test-mbsspn.sh
TESTS_ENVIRONMENT += LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
check_PROGRAMS += test-mbsspn
-test_mbsspn_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbsspn_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
<string.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
TESTS += test-mbsstr1 test-mbsstr2.sh test-mbsstr3.sh
TESTS_ENVIRONMENT += LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_ZH_CN='@LOCALE_ZH_CN@'
check_PROGRAMS += test-mbsstr1 test-mbsstr2 test-mbsstr3
-test_mbsstr1_LDADD = $(LDADD) $(LIBTHREAD)
-test_mbsstr2_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
-test_mbsstr3_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBTHREAD)
+test_mbsstr1_LDADD = $(LDADD) $(LIB_MBRTOWC)
+test_mbsstr2_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
+test_mbsstr3_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
<string.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
"mbswidth.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"mbuiter.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPL
"mkdir-p.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"propername.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"quote.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"quotearg.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
Include:
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
Makefile.am:
TESTS += test-quotearg-simple
check_PROGRAMS += test-quotearg-simple
-test_quotearg_simple_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_quotearg_simple_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC)
TESTS += test-quotearg.sh
TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
check_PROGRAMS += test-quotearg
-test_quotearg_LDADD = $(LDADD) $(LIB_SETLOCALE) @LIBINTL@ $(LIBTHREAD)
+test_quotearg_LDADD = $(LDADD) $(LIB_SETLOCALE) @LIBINTL@ $(LIB_MBRTOWC)
Makefile.am:
TESTS += test-readtokens.sh
check_PROGRAMS += test-readtokens
-test_readtokens_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_readtokens_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC)
<regex.h>
Link:
+$(LIB_MBRTOWC)
$(LIBTHREAD)
$(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise
"regex-quote.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
Makefile.am:
TESTS += test-regex-quote
check_PROGRAMS += test-regex-quote
-test_regex_quote_LDADD = $(LDADD) $(LIBINTL) $(LIBTHREAD)
+test_regex_quote_LDADD = $(LDADD) $(LIBINTL) $(LIB_MBRTOWC) $(LIBTHREAD)
Makefile.am:
TESTS += test-regex
check_PROGRAMS += test-regex
-test_regex_LDADD = $(LDADD) $(LIB_SETLOCALE) @LIBINTL@ $(LIBTHREAD)
+test_regex_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC) @LIBINTL@ $(LIBTHREAD)
<stdlib.h>
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
$(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise
License:
"sh-quote.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
Makefile.am:
TESTS += test-sh-quote
check_PROGRAMS += test-sh-quote
-test_sh_quote_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_sh_quote_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC)
"system-quote.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
Makefile.am:
TESTS += test-system-quote.sh
check_PROGRAMS += test-system-quote-main test-system-quote-child
-test_system_quote_main_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_system_quote_main_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC)
# The test-system-quote-child program must be a real executable, not a libtool
# wrapper script, and should link against as few libraries as possible.
# Therefore don't link it against any libraries other than -lc.
"trim.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"unistdio.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv3+ or GPLv2
TESTS += test-ulc-asnprintf1
check_PROGRAMS += test-ulc-asnprintf1
test_ulc_asnprintf1_SOURCES = unistdio/test-ulc-asnprintf1.c
-test_ulc_asnprintf1_LDADD = $(LDADD) $(LIBUNISTRING) @LIBICONV@ $(LIBTHREAD)
+test_ulc_asnprintf1_LDADD = $(LDADD) $(LIBUNISTRING) @LIBICONV@ $(LIB_MBRTOWC)
"unistdio.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv3+ or GPLv2
"unistdio.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv3+ or GPLv2
TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
check_PROGRAMS += test-ulc-vasnprintf1 test-ulc-vasnprintf2 test-ulc-vasnprintf3
test_ulc_vasnprintf1_SOURCES = unistdio/test-ulc-vasnprintf1.c
-test_ulc_vasnprintf1_LDADD = $(LDADD) $(LIBUNISTRING) @LIBICONV@ $(LIBTHREAD)
+test_ulc_vasnprintf1_LDADD = $(LDADD) $(LIBUNISTRING) @LIBICONV@ $(LIB_MBRTOWC)
test_ulc_vasnprintf2_SOURCES = unistdio/test-ulc-vasnprintf2.c
-test_ulc_vasnprintf2_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBUNISTRING) @LIBICONV@ $(LIBTHREAD)
+test_ulc_vasnprintf2_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBUNISTRING) @LIBICONV@ $(LIB_MBRTOWC)
test_ulc_vasnprintf3_SOURCES = unistdio/test-ulc-vasnprintf3.c
-test_ulc_vasnprintf3_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBUNISTRING) @LIBICONV@ $(LIBTHREAD)
+test_ulc_vasnprintf3_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBUNISTRING) @LIBICONV@ $(LIB_MBRTOWC)
"unistdio.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv3+ or GPLv2
TESTS += test-ulc-vasprintf1
check_PROGRAMS += test-ulc-vasprintf1
test_ulc_vasprintf1_SOURCES = unistdio/test-ulc-vasprintf1.c
-test_ulc_vasprintf1_LDADD = $(LDADD) $(LIBUNISTRING) @LIBICONV@ $(LIBTHREAD)
+test_ulc_vasprintf1_LDADD = $(LDADD) $(LIBUNISTRING) @LIBICONV@ $(LIB_MBRTOWC)
"unistdio.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv3+ or GPLv2
"unistdio.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv3+ or GPLv2
TESTS += test-ulc-vsnprintf1
check_PROGRAMS += test-ulc-vsnprintf1
test_ulc_vsnprintf1_SOURCES = unistdio/test-ulc-vsnprintf1.c
-test_ulc_vsnprintf1_LDADD = $(LDADD) $(LIBUNISTRING) @LIBINTL@ @LIBICONV@ $(LIBTHREAD)
+test_ulc_vsnprintf1_LDADD = $(LDADD) $(LIBUNISTRING) @LIBINTL@ @LIBICONV@ $(LIB_MBRTOWC)
"unistdio.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
LGPLv3+ or GPLv2
TESTS += test-ulc-vsprintf1
check_PROGRAMS += test-ulc-vsprintf1
test_ulc_vsprintf1_SOURCES = unistdio/test-ulc-vsprintf1.c
-test_ulc_vsprintf1_LDADD = $(LDADD) $(LIBUNISTRING) @LIBINTL@ @LIBICONV@ $(LIBTHREAD)
+test_ulc_vsprintf1_LDADD = $(LDADD) $(LIBUNISTRING) @LIBINTL@ @LIBICONV@ $(LIB_MBRTOWC)
"xfreopen.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"xmemcoll.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
"yesno.h"
Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
License:
GPL
Makefile.am:
TESTS += test-yesno.sh
check_PROGRAMS += test-yesno
-test_yesno_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_yesno_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC)