summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/errno.h4
-rw-r--r--include/libc-symbols.h5
-rw-r--r--include/netdb.h4
-rw-r--r--include/stap-probe.h12
4 files changed, 9 insertions, 16 deletions
diff --git a/include/errno.h b/include/errno.h
index dbf2a61e0d..8e60288f50 100644
--- a/include/errno.h
+++ b/include/errno.h
@@ -22,7 +22,7 @@
# define errno rtld_errno
extern int rtld_errno attribute_hidden;
-# elif !defined NOT_IN_libc || defined IN_LIB
+# elif !defined NOT_IN_libc || IS_IN_LIB
# include <tls.h>
@@ -34,7 +34,7 @@ extern int rtld_errno attribute_hidden;
# endif
extern __thread int errno attribute_tls_model_ie;
-# endif /* !NOT_IN_libc || IN_LIB */
+# endif /* !NOT_IN_libc || IS_IN_LIB */
# define __set_errno(val) (errno = (val))
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 5cbf47308d..52350d3b60 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -23,6 +23,11 @@
#define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME)
#define IS_IN(lib) (IN_MODULE == MODULE_##lib)
+/* Returns true if the current module is a versioned library. Versioned
+ library names culled from shlib-versions files are assigned a MODULE_*
+ value lower than MODULE_LIBS_BEGIN. */
+#define IS_IN_LIB (IN_MODULE > MODULE_LIBS_BEGIN)
+
#define PASTE_NAME(a,b) PASTE_NAME1 (a,b)
#define PASTE_NAME1(a,b) a##b
diff --git a/include/netdb.h b/include/netdb.h
index a7960ebdf7..eccdbe6462 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -4,7 +4,7 @@
#ifndef _ISOMAC
/* Macros for accessing h_errno from inside libc. */
-# if !defined NOT_IN_libc || defined IN_LIB
+# if !defined NOT_IN_libc || IS_IN_LIB
# undef h_errno
# ifndef NOT_IN_libc
# define h_errno __libc_h_errno
@@ -12,7 +12,7 @@
# define h_errno h_errno /* For #ifndef h_errno tests. */
# endif
extern __thread int h_errno attribute_tls_model_ie;
-# endif /* !NOT_IN_libc || IN_LIB */
+# endif /* !NOT_IN_libc || IS_IN_LIB */
# define __set_h_errno(x) (h_errno = (x))
libc_hidden_proto (hstrerror)
diff --git a/include/stap-probe.h b/include/stap-probe.h
index 150fc1ec26..6532b376b3 100644
--- a/include/stap-probe.h
+++ b/include/stap-probe.h
@@ -40,18 +40,6 @@
architecture specific and can be found in the gdb and SystemTap
source code. */
-# ifndef NOT_IN_libc
-# define IN_LIB libc
-# elif !defined IN_LIB
-/* This is intentionally defined with extra unquoted commas in it so
- that macro substitution will bomb out when it is used. We don't
- just use #error here, so that this header can be included by
- other headers that use LIBC_PROBE inside their own macros. We
- only want such headers to fail to compile if those macros are
- actually used in a context where IN_LIB has not been defined. */
-# define IN_LIB ,,,missing -DIN_LIB=... -- not extra-lib.mk?,,,
-# endif
-
# define LIBC_PROBE(name, n, ...) \
LIBC_PROBE_1 (MODULE_NAME, name, n, ## __VA_ARGS__)