OSDN Git Service

weak symbols need to be "defined" weak but "declared" strong
[uclinux-h8/uClibc.git] / libc / misc / internals / __h_errno_location.c
index f4f5980..c510c81 100644 (file)
@@ -1,10 +1,18 @@
-#define __FORCE_GLIBC
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
 #include <features.h>
 #include <netdb.h>
-#undef h_errno
 
-int * weak_const_function __h_errno_location (void)
+#ifndef __UCLIBC_HAS_TLS__
+# undef h_errno
+extern int h_errno;
+#endif
+
+int weak_const_function *__h_errno_location(void)
 {
     return &h_errno;
 }
-