* locale/duplocale.c: Include <string.h>.
authorRoland McGrath <roland@gnu.org>
Fri, 30 Aug 2002 22:07:28 +0000 (22:07 +0000)
committerRoland McGrath <roland@gnu.org>
Fri, 30 Aug 2002 22:07:28 +0000 (22:07 +0000)
ChangeLog
linuxthreads/ChangeLog
linuxthreads/Makefile
linuxthreads/pthread.c
linuxthreads/tst-static-locale.c [new file with mode: 0644]
locale/duplocale.c

index 8d9cf20..b27a3cd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2002-08-30  Roland McGrath  <roland@redhat.com>
 
+       * locale/duplocale.c: Include <string.h>.
+
        * intl/dcigettext.c (DCIGETTEXT) [_LIBC]: Check for bogus CATEGORY.
        [_LIBC] (category_to_name): Don't define the function.  Instead
        define a macro using _nl_category_names.
index 93193ae..ec9befe 100644 (file)
@@ -1,3 +1,13 @@
+2002-08-30  Jakub Jelinek  <jakub@redhat.com>
+
+        * pthread.c (__pthread_initialize_minimal): Call __uselocale even
+        if [! SHARED].
+
+2002-08-30  Roland McGrath  <roland@redhat.com>
+
+       * tst-static-locale.c: New file.
+       * Makefile (tests, tests-static): Add it.
+
 2002-04-24  Steven Munroe  <sjmunroe@us.ibm.com>
 
        * spinlock.c (__pthread_lock): Fix spurious wakeup
index ba43279..4f94de3 100644 (file)
@@ -65,8 +65,8 @@ tests = ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 $(librt-tests) ex12 ex13 joinrace \
 test-srcs = tst-signal
 
 ifeq ($(build-static),yes)
-tests += tststatic
-tests-static += tststatic
+tests += tststatic tst-static-locale
+tests-static += tststatic tst-static-locale
 endif
 
 ifeq (yes,$(build-shared))
index ae40254..f08bfd4 100644 (file)
@@ -479,7 +479,7 @@ __pthread_initialize_minimal(void)
 # endif
 #endif
 
-#if !(USE_TLS && HAVE___THREAD) && defined SHARED
+#if !(USE_TLS && HAVE___THREAD)
   /* Initialize thread-locale current locale to point to the global one.
      With __thread support, the variable's initializer takes care of this.  */
   __uselocale (LC_GLOBAL_LOCALE);
diff --git a/linuxthreads/tst-static-locale.c b/linuxthreads/tst-static-locale.c
new file mode 100644 (file)
index 0000000..3c88e72
--- /dev/null
@@ -0,0 +1,13 @@
+/* Test that the thread-local locale works right in the main thread
+   when statically linked.  */
+
+#include "../locale/tst-C-locale.c"
+
+#include <pthread.h>
+
+/* This is never called, just here to get pthreads linked in.  */
+void
+useless (void)
+{
+  pthread_create (0, 0, 0, 0);
+}
index df856a2..0e1e673 100644 (file)
@@ -21,6 +21,7 @@
 #include <locale.h>
 #include <bits/libc-lock.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include <localeinfo.h>