2001-05-23 15:26:42 +02:00
|
|
|
/*
|
|
|
|
* PROGRAM: JRD access method
|
|
|
|
* MODULE: ibsetjmp.h
|
|
|
|
* DESCRIPTION: Defines for setjmp/longjmp
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Interbase Public
|
|
|
|
* License Version 1.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy
|
|
|
|
* of the License at http://www.Inprise.com/IPL.html
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an
|
|
|
|
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
|
|
|
|
* or implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code was created by Inprise Corporation
|
|
|
|
* and its predecessors. Portions created by Inprise Corporation are
|
|
|
|
* Copyright (C) Inprise Corporation.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
* Contributor(s): ______________________________________.
|
|
|
|
*/
|
|
|
|
|
2003-10-03 03:53:34 +02:00
|
|
|
#ifndef JRD_IBSETJMP_H
|
|
|
|
#define JRD_IBSETJMP_H
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2008-04-10 11:25:48 +02:00
|
|
|
#ifdef UNIX
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2002-07-29 17:37:59 +02:00
|
|
|
#ifdef HAVE_SETJMP_H
|
2001-05-23 15:26:42 +02:00
|
|
|
#include <setjmp.h>
|
2002-07-29 17:37:59 +02:00
|
|
|
#endif
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2002-07-29 17:37:59 +02:00
|
|
|
#ifdef HAVE_SIGNAL_H
|
2001-05-23 15:26:42 +02:00
|
|
|
#include <signal.h>
|
2002-07-29 17:37:59 +02:00
|
|
|
#endif
|
2001-05-23 15:26:42 +02:00
|
|
|
|
|
|
|
#define START_CHECK_FOR_EXCEPTIONS(err) { \
|
2008-04-10 11:25:48 +02:00
|
|
|
sigjmp_buf sigenv; \
|
|
|
|
int sig; \
|
2004-04-06 09:25:45 +02:00
|
|
|
if (!Config::getBugcheckAbort()) { \
|
2008-04-10 11:25:48 +02:00
|
|
|
if (sig = sigsetjmp(sigenv, 1)) \
|
2004-04-06 09:25:45 +02:00
|
|
|
ISC_exception_post(sig, err); \
|
2008-04-10 11:25:48 +02:00
|
|
|
ISC_sync_signals_set(&sigenv); \
|
2004-04-06 09:25:45 +02:00
|
|
|
}
|
|
|
|
#define END_CHECK_FOR_EXCEPTIONS(err) if (!Config::getBugcheckAbort()) ISC_sync_signals_reset(); }
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2008-04-10 11:25:48 +02:00
|
|
|
#endif // UNIX
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2003-07-04 04:25:47 +02:00
|
|
|
#if defined(WIN_NT) && !defined(MINGW)
|
2001-05-23 15:26:42 +02:00
|
|
|
#include <excpt.h>
|
|
|
|
#define START_CHECK_FOR_EXCEPTIONS(err) __try {
|
2004-11-24 10:22:07 +01:00
|
|
|
#define END_CHECK_FOR_EXCEPTIONS(err) } __except ( ISC_exception_post(GetExceptionCode(), err)) { }
|
2008-04-10 11:25:48 +02:00
|
|
|
#endif // WIN_NT
|
2001-05-23 15:26:42 +02:00
|
|
|
|
|
|
|
/* generic macros */
|
|
|
|
#ifndef START_CHECK_FOR_EXCEPTIONS
|
|
|
|
#define START_CHECK_FOR_EXCEPTIONS(err)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef END_CHECK_FOR_EXCEPTIONS
|
|
|
|
#define END_CHECK_FOR_EXCEPTIONS(err)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2003-10-03 03:53:34 +02:00
|
|
|
#endif /* JRD_IBSETJMP_H */
|