diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-08-14 20:40:31 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-08-14 20:40:31 +0200 |
commit | bf991bc0f3006eddf45d494ee7e476a75dbaf36e (patch) | |
tree | 473cffc61678844358042c40102e8d44a824fd68 /include/osmocom | |
parent | 3f74d9e76795ef20ee401bbe712dd72733bfa77f (diff) |
core: Fix-up the OSMO_DEPRECATED for older compilers
The code started to use #if defined(...) but the value was always
for GCC/Clang. The only difference was that for older compilers
the value of the definition was 0. Conditionally define these
macros.
Diffstat (limited to 'include/osmocom')
-rw-r--r-- | include/osmocom/core/defs.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/osmocom/core/defs.h b/include/osmocom/core/defs.h index 917a8c3a..ca12a80f 100644 --- a/include/osmocom/core/defs.h +++ b/include/osmocom/core/defs.h @@ -27,11 +27,17 @@ /*! \brief Set the deprecated attribute with a message. */ #if defined(__clang__) -# define _OSMO_HAS_ATTRIBUTE_DEPRECATED __has_attribute(deprecated) -# define _OSMO_HAS_ATTRIBUTE_DEPRECATED_WITH_MESSAGE __has_extension(attribute_deprecated_with_message) +# if __has_attribute(deprecated) +# define _OSMO_HAS_ATTRIBUTE_DEPRECATED 1 +# endif +# if __has_extension(attribute_deprecated_with_message) +# define _OSMO_HAS_ATTRIBUTE_DEPRECATED_WITH_MESSAGE 1 +# endif #elif defined(__GNUC__) # define _OSMO_HAS_ATTRIBUTE_DEPRECATED 1 -# define _OSMO_HAS_ATTRIBUTE_DEPRECATED_WITH_MESSAGE OSMO_GNUC_PREREQ(4,5) +# if OSMO_GNUC_PREREQ(4,5) +# define _OSMO_HAS_ATTRIBUTE_DEPRECATED_WITH_MESSAGE 1 +# endif #endif #if defined(_OSMO_HAS_ATTRIBUTE_DEPRECATED_WITH_MESSAGE) |