]>
Commit | Line | Data |
---|---|---|
2524f1ce VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/except.h | |
3 | // Purpose: C++ exception related stuff | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 17.09.2003 | |
77ffb593 | 7 | // Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org> |
65571936 | 8 | // Licence: wxWindows licence |
2524f1ce VZ |
9 | /////////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_EXCEPT_H_ | |
12 | #define _WX_EXCEPT_H_ | |
13 | ||
14 | #include "wx/defs.h" | |
15 | ||
16 | // ---------------------------------------------------------------------------- | |
17 | // macros working whether wxUSE_EXCEPTIONS is 0 or 1 | |
18 | // ---------------------------------------------------------------------------- | |
19 | ||
06b76f7e VZ |
20 | // even if the library itself was compiled with exceptions support, the user |
21 | // code using it might be compiling with a compiler switch disabling them in | |
22 | // which cases we shouldn't use try/catch in the headers -- this results in | |
23 | // compilation errors in e.g. wx/scopeguard.h with at least g++ 4 | |
24 | #if !wxUSE_EXCEPTIONS || \ | |
25 | (defined(__GNUG__) && !defined(__EXCEPTIONS)) | |
d886c20e VZ |
26 | #ifndef wxNO_EXCEPTIONS |
27 | #define wxNO_EXCEPTIONS | |
28 | #endif | |
06b76f7e VZ |
29 | #endif |
30 | ||
31 | #ifdef wxNO_EXCEPTIONS | |
2524f1ce VZ |
32 | #define wxTRY |
33 | #define wxCATCH_ALL(code) | |
06b76f7e VZ |
34 | #else // do use exceptions |
35 | #define wxTRY try | |
36 | #define wxCATCH_ALL(code) catch ( ... ) { code } | |
37 | #endif // wxNO_EXCEPTIONS/!wxNO_EXCEPTIONS | |
2524f1ce VZ |
38 | |
39 | #endif // _WX_EXCEPT_H_ | |
40 |