]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/except.h
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: C++ exception related stuff
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
17 // ----------------------------------------------------------------------------
18 // macros working whether wxUSE_EXCEPTIONS is 0 or 1
19 // ----------------------------------------------------------------------------
21 // even if the library itself was compiled with exceptions support, the user
22 // code using it might be compiling with a compiler switch disabling them in
23 // which cases we shouldn't use try/catch in the headers -- this results in
24 // compilation errors in e.g. wx/scopeguard.h with at least g++ 4
25 #if !wxUSE_EXCEPTIONS || \
26 (defined(__GNUG__) && !defined(__EXCEPTIONS))
27 #define wxNO_EXCEPTIONS
30 #ifdef wxNO_EXCEPTIONS
32 #define wxCATCH_ALL(code)
33 #else // do use exceptions
35 #define wxCATCH_ALL(code) catch ( ... ) { code }
36 #endif // wxNO_EXCEPTIONS/!wxNO_EXCEPTIONS
38 #endif // _WX_EXCEPT_H_