OSDN Git Service

weak symbols need to be "defined" weak but "declared" strong
[uclinux-h8/uClibc.git] / libc / misc / internals / __errno_location.c
index 3409500..6c359f9 100644 (file)
@@ -4,10 +4,15 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
-#include "internal_errno.h"
+#include <features.h>
+#include <errno.h>
 
-int *__errno_location(void)
+#ifndef __UCLIBC_HAS_TLS__
+# undef errno
+extern int errno;
+#endif
+
+int weak_const_function *__errno_location(void)
 {
     return &errno;
 }
-libc_hidden_weak(__errno_location)