BLI_assert: prevent abort from suppressing return-type warning

Recent commit deaff945d0 broke release builds but not debug builds,
with this change the warning happens in both cases.
This commit is contained in:
Campbell Barton 2020-05-26 13:37:52 +10:00
parent 4e8693ffcd
commit 495a98d623
1 changed files with 7 additions and 1 deletions

View File

@ -69,7 +69,13 @@ extern "C" {
# endif
/* _BLI_ASSERT_ABORT */
# ifdef WITH_ASSERT_ABORT
# define _BLI_ASSERT_ABORT abort
# ifdef __GNUC__
/* Cast to remove 'noreturn' attribute since this suppresses missing return statements,
* allowing changes to debug builds to accidentally to break release builds. */
# define _BLI_ASSERT_ABORT ((void (*)(void))(*(((void **)abort))))
# else
# define _BLI_ASSERT_ABORT abort
# endif
# else
# define _BLI_ASSERT_ABORT() (void)0
# endif