core: Remove defined() check for OSMO_DEPRECATE

This reverts commit bf991bc0f3 and
fixes the bug instead. It's just sufficient to remove the defined()
test, since identifiers that aren't macros are just considered as
0 when used with #if. (see cpp info page, section 4.2.2 'If'
in cpp-4.6.info)
This commit is contained in:
Jacob Erlbeck 2013-08-15 10:38:05 +02:00 committed by Holger Hans Peter Freyther
parent bf991bc0f3
commit c4cc924074
1 changed files with 5 additions and 11 deletions

View File

@ -27,22 +27,16 @@
/*! \brief Set the deprecated attribute with a message. /*! \brief Set the deprecated attribute with a message.
*/ */
#if defined(__clang__) #if defined(__clang__)
# if __has_attribute(deprecated) # define _OSMO_HAS_ATTRIBUTE_DEPRECATED __has_attribute(deprecated)
# define _OSMO_HAS_ATTRIBUTE_DEPRECATED 1 # define _OSMO_HAS_ATTRIBUTE_DEPRECATED_WITH_MESSAGE __has_extension(attribute_deprecated_with_message)
# endif
# if __has_extension(attribute_deprecated_with_message)
# define _OSMO_HAS_ATTRIBUTE_DEPRECATED_WITH_MESSAGE 1
# endif
#elif defined(__GNUC__) #elif defined(__GNUC__)
# define _OSMO_HAS_ATTRIBUTE_DEPRECATED 1 # define _OSMO_HAS_ATTRIBUTE_DEPRECATED 1
# if OSMO_GNUC_PREREQ(4,5) # define _OSMO_HAS_ATTRIBUTE_DEPRECATED_WITH_MESSAGE OSMO_GNUC_PREREQ(4,5)
# define _OSMO_HAS_ATTRIBUTE_DEPRECATED_WITH_MESSAGE 1
# endif
#endif #endif
#if defined(_OSMO_HAS_ATTRIBUTE_DEPRECATED_WITH_MESSAGE) #if _OSMO_HAS_ATTRIBUTE_DEPRECATED_WITH_MESSAGE
# define OSMO_DEPRECATED(text) __attribute__((__deprecated__(text))) # define OSMO_DEPRECATED(text) __attribute__((__deprecated__(text)))
#elif defined(_OSMO_HAS_ATTRIBUTE_DEPRECATED) #elif _OSMO_HAS_ATTRIBUTE_DEPRECATED
# define OSMO_DEPRECATED(text) __attribute__((__deprecated__)) # define OSMO_DEPRECATED(text) __attribute__((__deprecated__))
#else #else
# define OSMO_DEPRECATED(text) # define OSMO_DEPRECATED(text)