2002-10-07 Roland McGrath <roland@redhat.com>
authorroland <roland>
Fri, 11 Oct 2002 10:52:01 +0000 (10:52 +0000)
committerroland <roland>
Fri, 11 Oct 2002 10:52:01 +0000 (10:52 +0000)
* include/tls.h: New file.
(USE___THREAD): New macro.
Define to 1 under [USE_TLS && HAVE___THREAD] and only when compiling
libc or libpthread.
* sysdeps/unix/sysv/linux/i386/sysdep.h [USE___THREAD]: Conditional
changed from [USE_TLS && HAVE___THREAD].
* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
* sysdeps/unix/i386/sysdep.S: Likewise.
* sysdeps/unix/x86_64/sysdep.S: Likewise.
* include/errno.h: Likewise.
* include/netdb.h: Likewise.
* include/resolv.h: Likewise.

include/netdb.h
include/resolv.h
include/tls.h [new file with mode: 0644]

index d58fe5b..423d5b4 100644 (file)
@@ -4,7 +4,7 @@
 /* Macros for accessing h_errno from inside libc.  */
 # ifdef _LIBC_REENTRANT
 #  include <tls.h>
-#  if USE_TLS && HAVE___THREAD
+#  if USE___THREAD
 #   undef  h_errno
 #   define h_errno h_errno     /* For #ifndef h_errno tests.  */
 extern __thread int h_errno;
index b9ed35e..2a4037c 100644 (file)
@@ -14,7 +14,7 @@
 
 # ifdef _LIBC_REENTRANT
 #  include <tls.h>
-#  if USE_TLS && HAVE___THREAD
+#  if USE___THREAD
 #   undef _res
 extern __thread struct __res_state _res;
 #  endif
diff --git a/include/tls.h b/include/tls.h
new file mode 100644 (file)
index 0000000..2e20a45
--- /dev/null
@@ -0,0 +1,14 @@
+/* This file defines USE___THREAD to 1 or 0 to cut down on the #if mess.  */
+
+#include_next <tls.h>
+
+#if USE_TLS && HAVE___THREAD \
+    && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+
+# define USE___THREAD 1
+
+#else
+
+# define USE___THREAD 0
+
+#endif