summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2000-03-22 05:43:53 +0000
committerRoland McGrath <roland@gnu.org>2000-03-22 05:43:53 +0000
commitcb832354c37fe97500b8de9b867d2794cfb902fa (patch)
treea4f98dd228315670f2c71dbba938d4f9e601c4fb /include
parent62ecda3d7c1346372d1cc69a7e726f851b0ef8a8 (diff)
downloadglibc-cb832354c37fe97500b8de9b867d2794cfb902fa.tar.gz
glibc-cb832354c37fe97500b8de9b867d2794cfb902fa.tar.xz
glibc-cb832354c37fe97500b8de9b867d2794cfb902fa.zip
2000-03-22 Roland McGrath <roland@baalperazim.frob.com>
	* include/shlib-compat.h (SHLIB_COMPAT): Take a third argument,
	indicating the first version set to obsolete the conditionalized code.
	* scripts/abi-versions.awk: For subsumed versions, make ABI_* defn's
	rhs be the ABI_* macro for the subsuming version.  Assign increasing
	integer values to the ABI_* macros for supported versions.
Diffstat (limited to 'include')
-rw-r--r--include/shlib-compat.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/include/shlib-compat.h b/include/shlib-compat.h
index a125d907c1..c91e6ce489 100644
--- a/include/shlib-compat.h
+++ b/include/shlib-compat.h
@@ -25,14 +25,22 @@
 # include <abi-versions.h>	/* header generated by abi-versions.awk */
 
 /* The file abi-versions.h (generated by scripts/abi-versions.awk) defines
-   symbols like `ABI_libm_GLIBC_2_0' to either 1 or 0 indicating whether or
-   not we want to build binary compatibility for e.g. the GLIBC_2.0 version
-   set into the libm shared object.  If this evaluates to zero, 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 `#if SHLIB_COMPAT (libm, GLIBC_2_0)'.  */
-
-# define SHLIB_COMPAT(lib, version)	ABI_##lib##_##version
+   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
+   version set, the definition gives the subsuming set, i.e. if GLIBC_2_0
+   is subsumed by GLIBC_2_1, then ABI_libm_GLIBC_2_0 == ABI_libm_GLIBC_2_1.
+   Each version set that is to be distinctly defined in the output has an
+   unique positive integer value, increasing with newer versions.  Thus,
+   evaluating two ABI_* symbols reduces to integer values that differ only
+   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) \
+  (ABI_##lib##_##introduced < ABI_##lib##_##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
@@ -51,7 +59,7 @@
 #else
 
 /* Not compiling ELF shared libraries at all, so never any old versions.  */
-# define SHLIB_COMPAT(lib, version)	0
+# define SHLIB_COMPAT(lib, introduced, obsoleted)	0
 
 /* No versions to worry about, just make this the global definition.  */
 # define versioned_symbol(lib, local, symbol, version) \