adding WX_ATTRIBUTE_NORETURN support (for functions like assert, exit etc. that may not return)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2012-06-13 23:33:00 +00:00
parent aa3cb98a40
commit 9deded7972

View File

@@ -175,6 +175,18 @@
# define wxSUPPRESS_GCC_PRIVATE_DTOR_WARNING(name)
#endif
/*
Clang Support
*/
#ifndef WX_HAS_CLANG_FEATURE
# ifndef __has_feature
# define WX_HAS_CLANG_FEATURE(x) 0
# else
# define WX_HAS_CLANG_FEATURE(x) __has_feature(x)
# endif
#endif
/* ---------------------------------------------------------------------------- */
/* wxWidgets version and compatibility defines */
/* ---------------------------------------------------------------------------- */
@@ -514,6 +526,17 @@ typedef short int WXTYPE;
# define WX_ATTRIBUTE_PRINTF_5 WX_ATTRIBUTE_PRINTF(5, 6)
#endif /* !defined(WX_ATTRIBUTE_PRINTF) */
#ifndef WX_ATTRIBUTE_NORETURN
# if WX_HAS_CLANG_FEATURE(attribute_analyzer_noreturn)
# define WX_ATTRIBUTE_NORETURN __attribute__((analyzer_noreturn))
# elif defined( __GNUC__ )
# define WX_ATTRIBUTE_NORETURN __attribute__ ((noreturn))
# elif wxCHECK_VISUALC_VERSION(7)
# define WX_ATTRIBUTE_NORETURN __declspec(noreturn)
# else
# define WX_ATTRIBUTE_NORETURN
# endif
#endif
/* Macro to issue warning when using deprecated functions with gcc3 or MSVC7: */
#if wxCHECK_GCC_VERSION(3, 1)