X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d9f819c69ba6bf1bd2438aa66aea90f314b8d13..880d76dfb12d4e8466df30d641bb25c6f71bd398:/include/wx/defs.h diff --git a/include/wx/defs.h b/include/wx/defs.h index a3a08d026f..3e87cac57c 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -583,6 +583,27 @@ typedef short int WXTYPE; # define wxDEPRECATED_BUT_USED_INTERNALLY(x) wxDEPRECATED(x) #endif +/* + Macros to suppress and restore gcc warnings, requires g++ >= 4.6 and don't + do anything otherwise. + + Example of use: + + wxGCC_WARNING_SUPPRESS(float-equal) + inline bool wxIsSameDouble(double x, double y) { return x == y; } + wxGCC_WARNING_RESTORE(float-equal) + */ +#if wxCHECK_GCC_VERSION(4, 6) +# define wxGCC_WARNING_SUPPRESS(x) \ + _Pragma (wxSTRINGIZE(GCC diagnostic push)) \ + _Pragma (wxSTRINGIZE(GCC diagnostic ignored wxSTRINGIZE(wxCONCAT(-W,x)))) +# define wxGCC_WARNING_RESTORE(x) \ + _Pragma (wxSTRINGIZE(GCC diagnostic pop)) +#else /* gcc < 4.6 or not gcc at all */ +# define wxGCC_WARNING_SUPPRESS(x) +# define wxGCC_WARNING_RESTORE(x) +#endif + /* Combination of the two variants above: should be used for deprecated functions which are defined inline and are used by wxWidgets itself. @@ -3335,17 +3356,6 @@ typedef const void* WXWidget; #define DECLARE_NO_ASSIGN_CLASS(classname) \ wxDECLARE_NO_ASSIGN_CLASS(classname); -/* Macro that can be used to indicate that a function doesn't throw. */ -#if defined(__cplusplus) && __cplusplus >= 199711L /* C++98 */ -# if __cplusplus >= 201103L /* >= C++11 */ -# define wxNOEXCEPT noexcept -# else -# define wxNOEXCEPT throw() -# endif -#else -# define wxNOEXCEPT -#endif - /* --------------------------------------------------------------------------- */ /* If a manifest is being automatically generated, add common controls 6 to it */ /* --------------------------------------------------------------------------- */