Define CGAL_NORETURN also for VC++ and move the macro before the functions

This commit is contained in:
Andreas Fabri 2018-02-14 14:51:40 +00:00
parent a7a4966de8
commit bcbbf35dad
2 changed files with 7 additions and 4 deletions

View File

@ -527,10 +527,13 @@ using std::max;
// Macro to specify a 'noreturn' attribute.
#if defined(__GNUG__) || __has_attribute(__noreturn__)
# define CGAL_NORETURN __attribute__ ((__noreturn__))
#else
#elif defined (_MSC_VER)
# define CGAL_NORETURN __declspec(noreturn)
#else
# define CGAL_NORETURN
#endif
// Macro CGAL_ASSUME
// Call a builtin of the compiler to pass a hint to the compiler
#if __has_builtin(__builtin_unreachable) || (CGAL_GCC_VERSION >= 40500 && !__STRICT_ANSI__)

View File

@ -63,9 +63,9 @@ namespace CGAL {
// =====================
// failure functions
// -----------------
CGAL_EXPORT void assertion_fail ( const char*, const char*, int, const char* = "") CGAL_NORETURN;
CGAL_EXPORT void precondition_fail ( const char*, const char*, int, const char* = "") CGAL_NORETURN;
CGAL_EXPORT void postcondition_fail ( const char*, const char*, int, const char* = "") CGAL_NORETURN;
CGAL_EXPORT CGAL_NORETURN void assertion_fail ( const char*, const char*, int, const char* = "") ;
CGAL_EXPORT CGAL_NORETURN void precondition_fail ( const char*, const char*, int, const char* = "") ;
CGAL_EXPORT CGAL_NORETURN void postcondition_fail ( const char*, const char*, int, const char* = "") ;
// warning function
// ----------------