2003-09-17 08:06:36 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/except.h
|
|
|
|
// Purpose: C++ exception related stuff
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17.09.2003
|
2004-05-23 10:56:36 -04:00
|
|
|
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2003-09-17 08:06:36 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_EXCEPT_H_
|
|
|
|
#define _WX_EXCEPT_H_
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// macros working whether wxUSE_EXCEPTIONS is 0 or 1
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2010-02-12 17:47:25 -05:00
|
|
|
// 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))
|
2010-07-17 07:55:10 -04:00
|
|
|
#ifndef wxNO_EXCEPTIONS
|
|
|
|
#define wxNO_EXCEPTIONS
|
|
|
|
#endif
|
2010-02-12 17:47:25 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef wxNO_EXCEPTIONS
|
2003-09-17 08:06:36 -04:00
|
|
|
#define wxTRY
|
|
|
|
#define wxCATCH_ALL(code)
|
2010-02-12 17:47:25 -05:00
|
|
|
#else // do use exceptions
|
|
|
|
#define wxTRY try
|
|
|
|
#define wxCATCH_ALL(code) catch ( ... ) { code }
|
|
|
|
#endif // wxNO_EXCEPTIONS/!wxNO_EXCEPTIONS
|
2003-09-17 08:06:36 -04:00
|
|
|
|
|
|
|
#endif // _WX_EXCEPT_H_
|
|
|
|
|