From b0f123c18ec3b4055ad6de19989f94e365484594 Mon Sep 17 00:00:00 2001 From: Matthias Maennich Date: Tue, 21 May 2019 05:39:14 +0100 Subject: [PATCH] Add deprecation facilities Add the macro 'ABG_DEPRECATED' to mark APIs as to be removed in a next major release. APIs marked with that flag are supposed to work as before, but might come with downsides. E.g. they could perform worse or provide only limited functionality. All deprecated functions shall come with a hint to equivalent functionality within the non-deprecated part of the API. * include/abg-fwd.h: Introduce deprecation macro ABG_DEPRECATED Signed-off-by: Matthias Maennich --- include/abg-fwd.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/abg-fwd.h b/include/abg-fwd.h index ddec06d..e925800 100644 --- a/include/abg-fwd.h +++ b/include/abg-fwd.h @@ -1342,5 +1342,14 @@ dump_decl_location(const decl_base_sptr&); #define ABG_ASSERT(cond) do {({bool __abg_cond__ = (cond); assert(__abg_cond__); !!__abg_cond__;});} while (false) #endif +/// Define ABG_DEPRECATED to allow marking parts of the API deprecated without +/// actually removing it. This allows to keep compatible (yet incomplete) APIs +/// around for a transition period into a major version. +#ifdef __GNUC__ +#define ABG_DEPRECATED __attribute__((deprecated)) +#else +#define ABG_DEPRECATED +#endif + } // end namespace abigail #endif // __ABG_IRFWD_H__ -- 2.7.4