File: except.h

package info (click to toggle)
wxpython3.0 3.0.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 482,760 kB
  • ctags: 518,293
  • sloc: cpp: 2,127,226; python: 294,045; makefile: 51,942; ansic: 19,033; sh: 3,013; xml: 1,629; perl: 17
file content (40 lines) | stat: -rw-r--r-- 1,380 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
///////////////////////////////////////////////////////////////////////////////
// Name:        wx/except.h
// Purpose:     C++ exception related stuff
// Author:      Vadim Zeitlin
// Modified by:
// Created:     17.09.2003
// Copyright:   (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence:     wxWindows licence
///////////////////////////////////////////////////////////////////////////////

#ifndef _WX_EXCEPT_H_
#define _WX_EXCEPT_H_

#include "wx/defs.h"

// ----------------------------------------------------------------------------
// macros working whether wxUSE_EXCEPTIONS is 0 or 1
// ----------------------------------------------------------------------------

// even if the library itself was compiled with exceptions support, the user
// code using it might be compiling with a compiler switch disabling them in
// which cases we shouldn't use try/catch in the headers -- this results in
// compilation errors in e.g. wx/scopeguard.h with at least g++ 4
#if !wxUSE_EXCEPTIONS || \
        (defined(__GNUG__) && !defined(__EXCEPTIONS))
    #ifndef wxNO_EXCEPTIONS
        #define wxNO_EXCEPTIONS
    #endif
#endif

#ifdef wxNO_EXCEPTIONS
    #define wxTRY
    #define wxCATCH_ALL(code)
#else // do use exceptions
    #define wxTRY try
    #define wxCATCH_ALL(code) catch ( ... ) { code }
#endif // wxNO_EXCEPTIONS/!wxNO_EXCEPTIONS

#endif // _WX_EXCEPT_H_