Add a macro to customize deprecation warnings.

This commit is contained in:
Maxime Gimeno 2016-06-02 14:47:37 +02:00
parent 97e122ccb8
commit 1a76a04931
1 changed files with 16 additions and 0 deletions

View File

@ -422,6 +422,22 @@ using std::max;
# define CGAL_DEPRECATED # define CGAL_DEPRECATED
#endif #endif
// Macro to trigger deprecation warnings with a custom message
#ifdef CGAL_NO_DEPRECATION_WARNINGS
# define CGAL_DEPRECATED_MSG
#elif defined(__GNUC__) || __has_attribute(__deprecated__)
# if BOOST_GCC >= 40500 || __has_attribute(__deprecated__)
# define CGAL_DEPRECATED_MSG(msg) __attribute__ ((deprecated(msg)))
# else
# define CGAL_DEPRECATED_MSG(msg) __attribute__ ((deprecated))
# endif
#elif defined (_MSC_VER) && (_MSC_VER > 1300)
# define CGAL_DEPRECATED_MSG(msg) __declspec(deprecated(msg))
#elif defined(__clang__)
# define CGAL_DEPRECATED_MSG(msg) __attribute__ ((deprecated(msg)))
#else
# define CGAL_DEPRECATED_MSG(msg)
#endif
// Macro to specify a 'noreturn' attribute. // Macro to specify a 'noreturn' attribute.
#if defined(__GNUG__) || __has_attribute(__noreturn__) #if defined(__GNUG__) || __has_attribute(__noreturn__)