]> Savannah Git Hosting - gnulib.git/commitdiff
mbrtowc: Ensure the mbtowc_lock is unique.
authorBruno Haible <bruno@clisp.org>
Fri, 3 Jan 2020 10:41:49 +0000 (11:41 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 3 Jan 2020 15:52:21 +0000 (16:52 +0100)
* 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.

107 files changed:
ChangeLog
lib/mbrtowc.c
lib/mbtowc-lock.c [new file with mode: 0644]
lib/mbtowc-lock.h [new file with mode: 0644]
m4/mbrtowc.m4
modules/acl
modules/acl-tests
modules/argmatch
modules/argmatch-tests
modules/backup-rename
modules/backupfile
modules/closein
modules/closein-tests
modules/closeout
modules/copy-file
modules/copy-file-tests
modules/csharpcomp
modules/csharpexec
modules/dfa
modules/dfa-tests
modules/exclude
modules/exclude-tests
modules/fnmatch
modules/fnmatch-gnu
modules/fnmatch-posix
modules/fnmatch-tests
modules/glob
modules/glob-tests
modules/human
modules/javacomp
modules/javaexec
modules/javaversion
modules/mbfile
modules/mbiter
modules/mbmemcasecmp
modules/mbmemcasecmp-tests
modules/mbmemcasecoll
modules/mbmemcasecoll-tests
modules/mbrlen
modules/mbrtowc
modules/mbrtowc-tests
modules/mbscasecmp
modules/mbscasecmp-tests
modules/mbscasestr
modules/mbscasestr-tests
modules/mbschr
modules/mbschr-tests
modules/mbscspn
modules/mbscspn-tests
modules/mbsinit
modules/mbsinit-tests
modules/mbslen
modules/mbsncasecmp
modules/mbsncasecmp-tests
modules/mbsnlen
modules/mbsnrtowcs
modules/mbsnrtowcs-tests
modules/mbspbrk
modules/mbspbrk-tests
modules/mbspcasecmp
modules/mbspcasecmp-tests
modules/mbsrchr
modules/mbsrchr-tests
modules/mbsrtowcs
modules/mbsrtowcs-tests
modules/mbssep
modules/mbsspn
modules/mbsspn-tests
modules/mbsstr
modules/mbsstr-tests
modules/mbstok_r
modules/mbswidth
modules/mbuiter
modules/mkdir-p
modules/propername
modules/quote
modules/quotearg
modules/quotearg-simple
modules/quotearg-simple-tests
modules/quotearg-tests
modules/readtokens-tests
modules/regex
modules/regex-quote
modules/regex-quote-tests
modules/regex-tests
modules/rpmatch
modules/sh-quote
modules/sh-quote-tests
modules/system-quote
modules/system-quote-tests
modules/trim
modules/unistdio/ulc-asnprintf
modules/unistdio/ulc-asnprintf-tests
modules/unistdio/ulc-fprintf
modules/unistdio/ulc-vasnprintf
modules/unistdio/ulc-vasnprintf-tests
modules/unistdio/ulc-vasprintf
modules/unistdio/ulc-vasprintf-tests
modules/unistdio/ulc-vfprintf
modules/unistdio/ulc-vsnprintf
modules/unistdio/ulc-vsnprintf-tests
modules/unistdio/ulc-vsprintf
modules/unistdio/ulc-vsprintf-tests
modules/xfreopen
modules/xmemcoll
modules/yesno
modules/yesno-tests

index 0fb2e1c3bc908efa5a4b07284178f2f97cdb2028..c18a95adf05af38c1ab839dbfa32883fc1c7a42a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,125 @@
+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.
index 1cdd1af204bea81b7f5ebf597f1d36968edfa25a..066d9495e35c1735f81195640fce4effaca076c1 100644 (file)
 # 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
@@ -93,12 +115,7 @@ locale_enc_cached (void)
 #  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
@@ -286,16 +303,7 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
       {
         /* 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)
           {
diff --git a/lib/mbtowc-lock.c b/lib/mbtowc-lock.c
new file mode 100644 (file)
index 0000000..85ad3c4
--- /dev/null
@@ -0,0 +1,150 @@
+/* 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
diff --git a/lib/mbtowc-lock.h b/lib/mbtowc-lock.h
new file mode 100644 (file)
index 0000000..e101978
--- /dev/null
@@ -0,0 +1,115 @@
+/* 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
index 5ad246fd4f928a0bbd94bf512d54942af2f3414a..bd9225b754fdda6897abf337eedf6e4335246060 100644 (file)
@@ -1,4 +1,4 @@
-# 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
@@ -8,6 +8,8 @@ dnl with or without modifications, as long as this notice is preserved.
 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
@@ -94,6 +96,23 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
       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
@@ -808,6 +827,12 @@ AC_DEFUN([gl_PREREQ_MBRTOWC], [
   :
 ])
 
+# Prerequisites of lib/mbtowc-lock.c.
+AC_DEFUN([gl_PREREQ_MBTOWC_LOCK],
+[
+  gl_VISIBILITY
+])
+
 
 dnl From Paul Eggert
 
index 9c398dddbb22b44c3d22fc0cc963a3f57dc9bb53..a0a5e459f1cad5948b1193056c23385272106e84 100644 (file)
@@ -22,7 +22,7 @@ Include:
 "acl.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 1c6b7c41cb6ad014649382708ef11d01637aa6e9..e4173fe9ae6ad4f672eb87dabd872c7f06720921 100644 (file)
@@ -25,6 +25,6 @@ TESTS += \
   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)
index 7fdbe6616183b3af4d52fb2ddac5c72ff507c8b2..97d84fbb93f453a2fb06000e5abac1baef4703cd 100644 (file)
@@ -27,7 +27,7 @@ Include:
 "argmatch.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 1b2f3c4ea457831c7d078eec9fc04406751cddfe..1ede023b8a84ec039620b706b1408586780bef0a 100644 (file)
@@ -9,5 +9,5 @@ configure.ac:
 Makefile.am:
 TESTS += test-argmatch
 check_PROGRAMS += test-argmatch
-test_argmatch_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_argmatch_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC)
 
index 65ebe45eb7ff187044b1547da1ea72f6ffcde2d5..0d6c34bd514cd37352a493fa456cee745ab3e6dd 100644 (file)
@@ -33,7 +33,7 @@ Include:
 "backupfile.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 67c79716c855b93b9b4ba1105965e66a48ae55bd..7916d6adcb5c02c5077b754151f520f25af167e8 100644 (file)
@@ -34,7 +34,7 @@ Include:
 "backupfile.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index a5e8a535a73c4f769446e808e7ff2de804491bfb..6a34d83bb683ffb1a12e9c3a200e639079c08776 100644 (file)
@@ -20,7 +20,7 @@ Include:
 "closein.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index bffa63afb782168f4465bc5dd124b5f265d1f688..dc288f2ea0502fafda1cf18242faa92ac302216d 100644 (file)
@@ -12,4 +12,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-closein.sh
 check_PROGRAMS += test-closein
-test_closein_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_closein_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC)
index 5482357754ccba16153511ac5fec19d0b7b53d1f..e51489f8bcad1f412451023a9ff33e6d46c4403d 100644 (file)
@@ -22,7 +22,7 @@ Include:
 "closeout.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 36d25af8ae2f536a1e72f2d51dfe190f484dbe9c..cc4a3c7e750343eae3d53b041991a91b93d4301b 100644 (file)
@@ -34,7 +34,7 @@ Include:
 "copy-file.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index d33de798ad3c7f88acde909c708c02901165b7af..a0788755f1371a22dbb92b8c20bc8c7f14872712 100644 (file)
@@ -18,4 +18,4 @@ Makefile.am:
 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)
index 9afcefa44f8d30515bcdc0e83a71106fd3cbf79b..62163f6a6ca368135516641e7b47d32da2306216 100644 (file)
@@ -28,7 +28,7 @@ Include:
 "csharpcomp.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index ed1723a21d7ed45c1698d8a282ebc012243dceb1..714e0b9d3cde6e18b743351bbe580b1be76194fd 100644 (file)
@@ -28,7 +28,7 @@ Include:
 "csharpexec.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index f1b00fe1edaa7885155e6dccfa6f0c8c0d8271f1..9b112afbae4ca5402891c4cf2c68fd66c2f36659 100644 (file)
@@ -38,7 +38,7 @@ Include:
 "localeinfo.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 0128dca2b0a40492b75e88f41beff03e72c3da60..5855652c90255a8b1c01c7757404f849d83d6814 100644 (file)
@@ -18,4 +18,4 @@ TESTS +=                      \
   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)
index d05fdb2b8556e66cd9486073ea89929d2b3b1a75..5ff0539348bc61fa4723142d6c6c3f54cd25127d 100644 (file)
@@ -25,7 +25,7 @@ Include:
 "exclude.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index f0dffe86a85e95da42ffbdb04af4e38f2cdb3449..f8372a3efbcba35c9c90cdff4172517d0f7f8e0d 100644 (file)
@@ -26,4 +26,4 @@ TESTS += \
  test-exclude8.sh
 
 check_PROGRAMS += test-exclude
-test_exclude_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_exclude_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC) $(LIBTHREAD)
index 67224571f9841a45736b62075976f4cb6359f4cf..50a2c71830cff6a41f2b196248c70820c399c1f3 100644 (file)
@@ -34,7 +34,7 @@ Include:
 <fnmatch.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv2+
index 8a592f236eb14276f34418b281ca078a561c5b01..f2c49de101ed1334d9094c949872be3c3ccb08e9 100644 (file)
@@ -20,7 +20,7 @@ Include:
 <fnmatch.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv2+
index f1e5b69dbb87317e6c3ffc599187e3cebfb191cd..508da562e9bb64090341bb40b26d737e6df9dc3e 100644 (file)
@@ -20,7 +20,7 @@ Include:
 "fnmatch.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv2+
index 55c94cb807ae2187e0dfa57e66b78d1ffba9bf91..5fd97c7e4d5f5bd88384b08e17102f7146036b37 100644 (file)
@@ -6,4 +6,4 @@ tests/macros.h
 Makefile.am:
 TESTS += test-fnmatch
 check_PROGRAMS += test-fnmatch
-test_fnmatch_LDADD = $(LDADD) $(LIBTHREAD)
+test_fnmatch_LDADD = $(LDADD) $(LIB_MBRTOWC)
index 0f7dad6f921ef393f98d731a258cb13efeaf0c8c..33d43bf394787268ba4fbaff18366f75f56e6f1e 100644 (file)
@@ -50,7 +50,7 @@ Include:
 <glob.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv2+
index 5e83c4350c42fc61c1334cdaec7fdf32c1dcfe6c..f551f6c9506a7f7bc1407d16a2ce22c847519688 100644 (file)
@@ -11,4 +11,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-glob
 check_PROGRAMS += test-glob
-test_glob_LDADD = $(LDADD) $(LIBTHREAD)
+test_glob_LDADD = $(LDADD) $(LIB_MBRTOWC)
index 362b8582fbfad3efdc46d567613a07c377719c16..58b1b79ca3db21dc0071d503d22cd6fd95b94e5a 100644 (file)
@@ -27,7 +27,7 @@ Include:
 "human.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 082a6c599a7decae27b42334fc6eda137ebebd0e..d1cc5597334e8f1308c2753b6b7b0ea1be8bc88b 100644 (file)
@@ -39,7 +39,7 @@ Include:
 "javacomp.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 04b997b4478ee8d6075e5141055e4a6f068ff546..773093e81d888c1a6c8bf52813ecd3c02fbe9068 100644 (file)
@@ -29,7 +29,7 @@ Include:
 "javaexec.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index b86edb008bffe4530c6585aac5b6b98bd8e0190e..d1e426c93a56c3c7d5cf03e26862e24a66ec7530 100644 (file)
@@ -26,7 +26,7 @@ Include:
 "javaversion.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 386f3e93e916fbb50194b700465469e6d870422c..ae7704b88e7fdd5d6b7c4c53f970842e4ab4d26b 100644 (file)
@@ -25,7 +25,7 @@ Include:
 "mbfile.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 347e7776e04baa974f042bb45758a444204f1244..0f08040e7d4f1e707f728d4f4871dbd9099e3f14 100644 (file)
@@ -25,7 +25,7 @@ Include:
 "mbiter.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv2+
index 22075b568ee9cab9aee6fb944523aa45c33bf21c..1af2b1cad5ffcdf0558abd33f7bef07f02b6f569 100644 (file)
@@ -17,7 +17,7 @@ Include:
 "mbmemcasecmp.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 16a11231c24639cb18e3cb8dafd61bf068e21d87..69c1d0e17d7875fdb1ca2c87283c9e0c3340f306 100644 (file)
@@ -25,4 +25,4 @@ TESTS_ENVIRONMENT += \
   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)
index e0674fa47f21c75ab987979331233d6ba8d18e48..db20df0ee72b4e49081359b00d0c1c60673a0a9b 100644 (file)
@@ -24,7 +24,7 @@ Include:
 "mbmemcasecoll.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 56a3db0af2f6d3936d778c622cfbb69e473afddc..5201618048ee91b17b8ee297ce9532666168768b 100644 (file)
@@ -25,4 +25,4 @@ TESTS_ENVIRONMENT += \
   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)
index e1caa2a879887246d6a08cf89ec0973e2cdedfad..b06362a7bcd6833091b0a9030dbee507ced0e4c3 100644 (file)
@@ -25,7 +25,7 @@ Include:
 <wchar.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index d2dc54cf9ac08cc4009ce6cf5af22ad363a87c20..db102566070f7641e014eaa0865d62462043763c 100644 (file)
@@ -3,12 +3,17 @@ mbrtowc() function: convert multibyte character to wide character.
 
 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
@@ -19,13 +24,14 @@ mbsinit         [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
 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])
 
@@ -35,7 +41,7 @@ Include:
 <wchar.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv2+
index f5c9166f1d26920396476fb06c423fab9fe9881c..6331be01d0f1b071b5363b8fd628e0418f356a31 100644 (file)
@@ -45,4 +45,4 @@ TESTS_ENVIRONMENT += \
   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)
index 2be11e0d10139fcc900698af813755ec8eafb306..6c4249c88d8879c0a1652b522e77dea6c854aba2 100644 (file)
@@ -18,7 +18,7 @@ Include:
 <string.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 9f77064c3b17a2d102c4e06c5ce17f223477462f..6894553a5e73ecf7a7bd2c2baf7035ef23bd1eef 100644 (file)
@@ -15,4 +15,4 @@ Makefile.am:
 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)
index a731dd06c08d86419ad885e260b3c8c722cdc2fa..8c12c8d3b5ebf2bf97b8ad66362d9a11db800606 100644 (file)
@@ -23,7 +23,7 @@ Include:
 <string.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 3395c1fd8cb78051059fde9b24e76a61a3302196..0def3bf97b015b35a7336a8b6cc848b49f7f7962 100644 (file)
@@ -24,7 +24,7 @@ Makefile.am:
 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)
index ca67f300efa61932311a6d9e66b497c42f2ad983..dd55613e4bec6a3a665d16aa6b5b0b73deb167a6 100644 (file)
@@ -18,7 +18,7 @@ Include:
 <string.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 33ee83fdcf694f85ba23d463a9daddab73af1766..85e30f657104ab0c70eaf2b5dfdbb5cbbdd91f1d 100644 (file)
@@ -15,4 +15,4 @@ Makefile.am:
 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)
index 6861e61a3dbe2f489fad21eb227f9c50cdd9a5dc..95cc670d2825fa1d02b3d0de598dcd3a0339c5bf 100644 (file)
@@ -20,7 +20,7 @@ Include:
 <string.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 8c4a3d154dad6d9f3f5a4e8b7a50ce40834e1f29..effac53d1667bb0a5b61553820cbeb028484a243 100644 (file)
@@ -15,4 +15,4 @@ Makefile.am:
 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)
index 941c583889a6f7e823765ccd32628ac8764cc736..3f7596d0eef357833e9924fcfaf80dfd291d5d41 100644 (file)
@@ -26,7 +26,7 @@ Include:
 <wchar.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv2+
index 0674e9c610644dfeedc42f63c387b3f030256d97..b41fff3330f5dc7128b6cc0f3d8210787aba3f48 100644 (file)
@@ -17,4 +17,4 @@ Makefile.am:
 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)
index ed8dfe7fbeb7bb8819ec63d1870a63c253eeca00..41a2531ffb4eb8ac8aab377cf30f84a253b144de 100644 (file)
@@ -20,7 +20,7 @@ Include:
 <string.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 2857f4f816787bee48d305ef7e7d760be8553f41..5dc287ddaad34d6b7408a7d5bfbb410784fc6a6a 100644 (file)
@@ -18,7 +18,7 @@ Include:
 <string.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 050201a5c2400e48ecdd29e0dde5683a85c8cde1..a18fc3b2716c8ec077c3e0b1d8609916cc7c3dc1 100644 (file)
@@ -15,4 +15,4 @@ Makefile.am:
 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)
index fa2296400f9a3f68823b43b3d7882db383bf5baf..0d4ad37fe102208c0c43795466e100cbf1233a2d 100644 (file)
@@ -18,7 +18,7 @@ Include:
 <string.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv2+
index b1a9721c0ff92f6f90a4558858489fe9b4d8355b..2f1c52db9a452f2599b72a129f34bb6e2a45782d 100644 (file)
@@ -30,7 +30,7 @@ Include:
 <wchar.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 4d90f17a81d72de1860fe9f7883ea7c70491a2c6..ce5ae468bbb095c543068ad59d5a38efaf0cd3d6 100644 (file)
@@ -31,4 +31,4 @@ TESTS_ENVIRONMENT += \
   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)
index 77bf03fc5add120854935a340b743f42cbadbc09..5a167f320703a2a0a871ad351af19a5692f37c47 100644 (file)
@@ -20,7 +20,7 @@ Include:
 <string.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 902e5b39c5466600a1e63876974989080f26c9ec..bb001fe88dfb43faf2c96c2c6c59b832e86fc074 100644 (file)
@@ -15,4 +15,4 @@ Makefile.am:
 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)
index 9e8753697b51d872729b0b0551cadfa9178f4e80..f581f82a81cb4b2e7bb7344d8b02636eeeb3769f 100644 (file)
@@ -18,7 +18,7 @@ Include:
 <string.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index e6f11ffa4dffad664fccef63f9340f2e212c4241..b6b0e2d82cba6afbd63d58396460474bc85405bc 100644 (file)
@@ -15,4 +15,4 @@ Makefile.am:
 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)
index b73b59f70a2bbef87188755a5ffd8318ca48395a..6f272e0d4476550b641df81b3e67c47e35e83b4a 100644 (file)
@@ -18,7 +18,7 @@ Include:
 <string.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 1d9780426d00bf615ed8295509b5b223b013a720..d104196256c573aee28d060e4a7c7f0fc94aecee 100644 (file)
@@ -15,4 +15,4 @@ Makefile.am:
 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)
index c742f49d3bc25522b2bc26cf39033d72856d8a78..9da2d07416e5e8de09add15c638e52a1b5051d0c 100644 (file)
@@ -33,7 +33,7 @@ Include:
 <wchar.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv2+
index 3de9d73f6170e71700149de74b8d0036963f1bbb..8073a53a4780d0217dfec781a0c77f0fdf99f90e 100644 (file)
@@ -31,4 +31,4 @@ TESTS_ENVIRONMENT += \
   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)
index 465dc511438ba8e6b79bd30d444d87c996ae7e65..7e3726dbef3314ea2de5504d3c7a83c2d94ae2c8 100644 (file)
@@ -20,7 +20,7 @@ Include:
 <string.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 6cec1da2e0cfeba99c97f9523a2b187c55536f6f..8d6308408697efe8d2fc6305be833d70d03922a1 100644 (file)
@@ -19,7 +19,7 @@ Include:
 <string.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 994a7062e6de5eafce3a84da4a5dd2991fdad251..af1740144d699b094184b7749c88d70f3fe093df 100644 (file)
@@ -15,4 +15,4 @@ Makefile.am:
 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)
index 5b418dce22d74e9b73c15ad54f80662718f4f762..5458607a2ba2fbbf820e74adec4334e74a947326 100644 (file)
@@ -23,7 +23,7 @@ Include:
 <string.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 739e51deec92a8e1373e6c783788294b6695ca7b..697aaf829a2ff8eca9949f70daf755b31893cb8f 100644 (file)
@@ -20,6 +20,6 @@ Makefile.am:
 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)
index 67de3d772a0f6e2563de10fac6876838bbd0797f..ad518bb6a523a939d90cdb6fc11398a9990b7686 100644 (file)
@@ -21,7 +21,7 @@ Include:
 <string.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 934ab5924a126fd69328e17002d77c7ba5a5a2c7..736d9021dab86dbc46a4077447fe33bd63d6ea32 100644 (file)
@@ -26,7 +26,7 @@ Include:
 "mbswidth.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 6763f0bb5629be2558cfe4fb02edae998bfe7326..78af61dcaeea22961e801f52dab343d75422a55a 100644 (file)
@@ -26,7 +26,7 @@ Include:
 "mbuiter.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPL
index 72f8b0987a79d4f80f497f70c568f4b4fd8adc53..a9df81aed86e227ed8bbbea20d7519e039e6fc77 100644 (file)
@@ -34,7 +34,7 @@ Include:
 "mkdir-p.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 22d60735a97344f81b46f37fabd50c45796b5aa8..e753ee7d90fbe5e0873d06d36938c1b05313b414 100644 (file)
@@ -36,7 +36,7 @@ Include:
 "propername.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index a01a16d1fc856a70dc6a873587256e3d26c93cdb..35c30ce5392a8eb763f8b028737ffe384fadf29a 100644 (file)
@@ -17,7 +17,7 @@ Include:
 "quote.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 3d56dc53bba682744f49a5576760421ff0c7b8ae..9d9276ed1e781d1d446a6273d9e66416190a7484 100644 (file)
@@ -35,7 +35,7 @@ Include:
 "quotearg.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 5ba13ce2358f7cb789874480955142b8d1918566..6a5c89296deb06d5d920716d5f368d288a914f4f 100644 (file)
@@ -13,7 +13,7 @@ Makefile.am:
 Include:
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 701da5f1e96b57fb1f659f8b0d07da1ceb6c4f92..5470dfe3afe836d701e74d784f0507ded3003348 100644 (file)
@@ -18,4 +18,4 @@ AC_CHECK_FUNCS_ONCE([mprotect])
 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)
index 77fde80499ad2fe44b40864d64bbd2da1393000d..aed92ce381636518d5e00dc5de93c35fc0686f24 100644 (file)
@@ -27,4 +27,4 @@ Makefile.am:
 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)
index 5e83e47c43bee39cc75c615da993eaa9cbf8050b..9e4c0606b96ba957bcebd1a821acb1e42d4c55d1 100644 (file)
@@ -11,4 +11,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-readtokens.sh
 check_PROGRAMS += test-readtokens
-test_readtokens_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_readtokens_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC)
index 42c93443cf292acc638ce6e3b69c4818e9dd61d3..9d77df7aebfd0cf80e10b62a24a567a9cb967b15 100644 (file)
@@ -49,6 +49,7 @@ Include:
 <regex.h>
 
 Link:
+$(LIB_MBRTOWC)
 $(LIBTHREAD)
 $(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise
 
index 085e5b6bc7f914f5abe2bdfb2b6a73038d8aedf4..9b67ca20c4386e4592dddcb8ecdea5e02d7c8ada 100644 (file)
@@ -19,7 +19,7 @@ Include:
 "regex-quote.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index b396a007a70739eb6317442b94d2516b70129f64..aa99cd096e61c360f3d31fec868b85cee5034d9b 100644 (file)
@@ -11,4 +11,4 @@ configure.ac:
 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)
index e8821ec52d8a82b6176c9ce95f9fb3d849b253fe..711632aa06908f1ffd76fe5e77effb295238edf0 100644 (file)
@@ -11,4 +11,4 @@ configure.ac:
 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)
index 3b754c6701c2741a0b6b6b438bf6c9d8bbd9ecda..2e0e7e3067e713636f6a3628946929ab540384e1 100644 (file)
@@ -27,7 +27,7 @@ Include:
 <stdlib.h>
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 $(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise
 
 License:
index a95dea9af6e231681e0eb3f0c2b419813acda901..83fa08905c0651b4236f932198b2e1a38b8848ba 100644 (file)
@@ -18,7 +18,7 @@ Include:
 "sh-quote.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 8252fee88d2c3d449887f1238e016e46aba2e998..2ac972294528456d021e67db8839a4e5db103580 100644 (file)
@@ -8,4 +8,4 @@ configure.ac:
 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)
index 09503e53ce92447598920dee4d6c145fd8a544b0..f34d58aff0e98cd3aeeeef43e2b255512c53cb03 100644 (file)
@@ -18,7 +18,7 @@ Include:
 "system-quote.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 413453b081861998809ba10042a0f9647c803fa8..4e2782a9a959ef6e14424555d48a74394b2bd43a 100644 (file)
@@ -18,7 +18,7 @@ configure.ac:
 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.
index 13d3579a69a6a7084a440b00a002561d26ae545a..3d29e3a75d8c1f2d79713d700c7a15f7e580d644 100644 (file)
@@ -21,7 +21,7 @@ Include:
 "trim.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index a0c1d1fbd0aab3acfb37d30b88a56ef76c0e49e5..7a8255bbd0217c40cd82dda31994ebd2b1ffe9ed 100644 (file)
@@ -22,7 +22,7 @@ Include:
 "unistdio.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv3+ or GPLv2
index 276c7e5bffd4433ca88309be327447b0a74bad8d..16699cde32fe9b0a24bf3b72467e14d2cbed9826 100644 (file)
@@ -12,4 +12,4 @@ Makefile.am:
 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)
index ad3d2d8394e9f44e667e389848c151ae9b7a1ef1..74c8269dcd34c7c3f9d660879d2fb06fbe85c98d 100644 (file)
@@ -22,7 +22,7 @@ Include:
 "unistdio.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv3+ or GPLv2
index 77a0b8c7503b74da164a27097a21a57dee20d504..750602f8613febf2dc8b3ef6e3f145127bb041f3 100644 (file)
@@ -58,7 +58,7 @@ Include:
 "unistdio.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv3+ or GPLv2
index 0af236161dd2c5c94425422d1d498b5b79b712e2..55e55ce84de45cafcb4c82e0281d113492dfc6f7 100644 (file)
@@ -22,8 +22,8 @@ TESTS += test-ulc-vasnprintf1 unistdio/test-ulc-vasnprintf2.sh unistdio/test-ulc
 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)
index 19965c1aab421a8261edd5568a1cae336168b3b0..f84da4148167803ac1180516145c04f5c8d5afa5 100644 (file)
@@ -22,7 +22,7 @@ Include:
 "unistdio.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv3+ or GPLv2
index b034f3f65f2eee1c0793e9203a13674b93e6be32..abbdfc54b00d0c8ce4edd480c57937d150315ce7 100644 (file)
@@ -11,4 +11,4 @@ Makefile.am:
 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)
index 28d19ab457b48bc34b372be710df01f183173ab3..590a29935fd98f054cbbcdd89fc06f11246aea7a 100644 (file)
@@ -22,7 +22,7 @@ Include:
 "unistdio.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv3+ or GPLv2
index c204b75625d1e5506cd39faad45a31fc11644c71..5f69d4d28c2368b671a3c13470f6180ff3a88a6a 100644 (file)
@@ -22,7 +22,7 @@ Include:
 "unistdio.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv3+ or GPLv2
index 029a825b780fd0538b3b6edc69671ff91ac5141f..735a111cfd3ff1630cd425c636421da93bc8fee4 100644 (file)
@@ -12,4 +12,4 @@ Makefile.am:
 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)
index b536826cd603396909d6fe3cdbc328f5e6ddd00a..de233b0b8ea6e05fc5e7f99e0fc8e032844c86b2 100644 (file)
@@ -23,7 +23,7 @@ Include:
 "unistdio.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 LGPLv3+ or GPLv2
index 32b1b5ce394d68386d9d832dc116ec5614b3a507..98a6a6ce06f8156b870d3bb4b777961849e09746 100644 (file)
@@ -12,4 +12,4 @@ Makefile.am:
 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)
index 63266db52ca376a536a7fee56edfc0fd364943e9..dfd3d9ef57d31951262a9b11820d498b0046a17b 100644 (file)
@@ -20,7 +20,7 @@ Include:
 "xfreopen.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 4f13d85a43ea8ebd0ff1cdd71eeafc4dff3fe87e..97249452fa0e0f4bbfe45f4b855cc51778c43017 100644 (file)
@@ -21,7 +21,7 @@ Include:
 "xmemcoll.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 8ae50df3223005918d8ebc13a74864cac451f32b..7a45e0f8bb11597342b2804743f90a0fd96558b2 100644 (file)
@@ -22,7 +22,7 @@ Include:
 "yesno.h"
 
 Link:
-$(LIBTHREAD)
+$(LIB_MBRTOWC)
 
 License:
 GPL
index 8836ee875ab81abc5a4758c9a911e3e09e2c30a9..45f429fe9c3b38debd9b8a2031cb2985ceb3a274 100644 (file)
@@ -12,4 +12,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-yesno.sh
 check_PROGRAMS += test-yesno
-test_yesno_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_yesno_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC)