aboutsummaryrefslogtreecommitdiff
path: root/include/shlib-compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/shlib-compat.h')
-rw-r--r--include/shlib-compat.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/include/shlib-compat.h b/include/shlib-compat.h
index 43583bbe2e..28baef1ea4 100644
--- a/include/shlib-compat.h
+++ b/include/shlib-compat.h
@@ -21,8 +21,6 @@
# include <abi-versions.h>
-#ifdef SHARED
-
/* The file abi-versions.h (generated by scripts/abi-versions.awk) defines
symbols like `ABI_libm_GLIBC_2_0' for each version set in the source
code for each library. For a version set that is subsumed by a later
@@ -34,17 +32,24 @@
when the two version sets named are in fact two different ABIs we are
supporting. If these do not differ, then there is no need to compile in
extra code to support this version set where it has been superseded by a
- newer version. The compatibility code should be conditionalized with
- e.g. `#if SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_2)' for code introduced
- in the GLIBC_2.0 version and obsoleted in the GLIBC_2.2 version. */
-
-# define SHLIB_COMPAT(lib, introduced, obsoleted) \
- _SHLIB_COMPAT (lib, introduced, obsoleted)
-# define _SHLIB_COMPAT(lib, introduced, obsoleted) \
+ newer version. */
+#define LIB_COMPAT(lib, introduced, obsoleted) \
+ _LIB_COMPAT (lib, introduced, obsoleted)
+#define _LIB_COMPAT(lib, introduced, obsoleted) \
(IS_IN (lib) \
&& (!(ABI_##lib##_##obsoleted - 0) \
|| ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0))))
+#ifdef SHARED
+
+/* Similar to LIB_COMPAT, but evaluate to 0 for static build. The
+ compatibility code should be conditionalized with e.g.
+ `#if SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_2)' for code introduced
+ in the GLIBC_2.0 version and obsoleted in the GLIBC_2.2 version. */
+
+# define SHLIB_COMPAT(lib, introduced, obsoleted) \
+ _LIB_COMPAT (lib, introduced, obsoleted)
+
/* That header also defines symbols like `VERSION_libm_GLIBC_2_1' to
the version set name to use for e.g. symbols first introduced into
libm in the GLIBC_2.1 version. Definitions of symbols with explicit