Browse Source

Move __clone/__uselocale to uClibc_glue.h

Peter S. Mazinger 18 years ago
parent
commit
55628cb04c

+ 2 - 5
libpthread/linuxthreads/libc_pthread_init.c

@@ -28,9 +28,6 @@
 #ifdef SHARED
 libc_hidden_proto(memcpy)
 #endif
-#if !(USE_TLS && HAVE___THREAD) && defined __UCLIBC_HAS_XLOCALE__
-libc_hidden_proto(uselocale)
-#endif
 
 int *
 __libc_pthread_init (functions)
@@ -44,10 +41,10 @@ __libc_pthread_init (functions)
 	  sizeof (__libc_pthread_functions));
 #endif
 
-#if !(USE_TLS && HAVE___THREAD) && defined __UCLIBC_HAS_XLOCALE__
+#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);
+  __uselocale (LC_GLOBAL_LOCALE);
 #endif
 
   return &__libc_multiple_threads;

+ 0 - 7
libpthread/linuxthreads/manager.c

@@ -37,11 +37,6 @@
 #include "semaphore.h"
 #include <not-cancel.h>
 
-#define __clone clone
-#if !(USE_TLS && HAVE___THREAD) && defined __UCLIBC_HAS_XLOCALE__
-#define __uselocale(x) uselocale(x)
-#endif
-
 /* For debugging purposes put the maximum number of threads in a variable.  */
 const int __linuxthreads_pthread_threads_max = PTHREAD_THREADS_MAX;
 
@@ -297,9 +292,7 @@ pthread_start_thread(void *arg)
 #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.  */
-#ifdef __UCLIBC_HAS_XLOCALE__
   __uselocale (LC_GLOBAL_LOCALE);
-#endif
 #else
   /* Initialize __resp.  */
   __resp = &self->p_res;

+ 8 - 0
libpthread/linuxthreads/sysdeps/pthread/uClibc-glue.h

@@ -27,12 +27,20 @@
 #define __close close
 #define __on_exit on_exit
 #define __libc_current_sigrtmin_private __libc_current_sigrtmin
+#define __clone clone
 
 extern void *__libc_stack_end;
 extern int __cxa_atexit (void (*func) (void *), void *arg, void *d);
 
 #endif /* IS_IN_libpthread */
 
+#ifdef __UCLIBC_HAS_XLOCALE__
+# define __uselocale(x) uselocale(x)
+libc_hidden_proto(uselocale)
+#else
+# define __uselocale(x) ((void)0)
+#endif
+
 /* Use a funky version in a probably vein attempt at preventing gdb 
  * from dlopen()'ing glibc's libthread_db library... */
 #define STRINGIFY(s) STRINGIFY2 (s)