summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/errno.h4
-rw-r--r--include/netdb.h22
2 files changed, 14 insertions, 12 deletions
diff --git a/include/errno.h b/include/errno.h
index 98c6080528..f1b93a881b 100644
--- a/include/errno.h
+++ b/include/errno.h
@@ -17,7 +17,7 @@
# define errno rtld_errno
extern int rtld_errno attribute_hidden;
-# else
+# elif !defined NOT_IN_libc || defined IN_LIB
# include <tls.h>
@@ -29,7 +29,7 @@ extern int rtld_errno attribute_hidden;
# endif
extern __thread int errno attribute_tls_model_ie;
-# endif /* RTLD_PRIVATE_ERRNO */
+# endif /* !NOT_IN_libc || IN_LIB */
# define __set_errno(val) (errno = (val))
diff --git a/include/netdb.h b/include/netdb.h
index 3f2ae06451..8a569baef3 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -3,18 +3,20 @@
#ifndef _ISOMAC
/* Macros for accessing h_errno from inside libc. */
-# undef h_errno
-# ifdef _LIBC_REENTRANT
-# include <tls.h>
-# ifndef NOT_IN_libc
-# define h_errno __libc_h_errno
-# else
-# define h_errno h_errno /* For #ifndef h_errno tests. */
-# endif
+# if !defined NOT_IN_libc || defined IN_LIB
+# undef h_errno
+# ifdef _LIBC_REENTRANT
+# include <tls.h>
+# ifndef NOT_IN_libc
+# define h_errno __libc_h_errno
+# else
+# define h_errno h_errno /* For #ifndef h_errno tests. */
+# endif
extern __thread int h_errno attribute_tls_model_ie;
-# else
+# else
extern int h_errno;
-# endif /* _LIBC_REENTRANT */
+# endif /* _LIBC_REENTRANT */
+# endif /* !NOT_IN_libc || IN_LIB */
# define __set_h_errno(x) (h_errno = (x))
libc_hidden_proto (hstrerror)