2001-05-23 15:26:42 +02:00
|
|
|
/*
|
|
|
|
* 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): ______________________________________.
|
|
|
|
*/
|
2001-12-24 03:51:06 +01:00
|
|
|
#ifndef JRD_GDSASSERT_H
|
|
|
|
#define JRD_GDSASSERT_H
|
2001-05-23 15:26:42 +02:00
|
|
|
|
|
|
|
|
2004-06-08 15:41:08 +02:00
|
|
|
#include "../jrd/gds_proto.h"
|
|
|
|
|
2001-05-23 15:26:42 +02:00
|
|
|
#ifdef DEV_BUILD
|
|
|
|
|
2003-11-04 00:59:24 +01:00
|
|
|
#include <stdlib.h> // abort()
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2004-04-29 00:36:29 +02:00
|
|
|
#include <stdio.h>
|
2001-05-23 15:26:42 +02:00
|
|
|
|
|
|
|
|
2003-11-04 00:59:24 +01:00
|
|
|
/* fb_assert() has been made into a generic version that works across
|
|
|
|
* gds components. Previously, the fb_assert() defined here was only
|
2001-05-23 15:26:42 +02:00
|
|
|
* usable within the engine.
|
|
|
|
* 1996-Feb-09 David Schnepper
|
|
|
|
*/
|
2001-12-24 03:51:06 +01:00
|
|
|
|
2003-08-20 11:35:00 +02:00
|
|
|
#define FB_GDS_ASSERT_FAILURE_STRING "GDS Assertion failure: %s %"LINEFORMAT"\n"
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2001-12-24 03:51:06 +01:00
|
|
|
#ifdef SUPERSERVER
|
|
|
|
|
2004-02-20 07:43:27 +01:00
|
|
|
#define fb_assert(ex) {if (!(ex)) {gds__log (FB_GDS_ASSERT_FAILURE_STRING, __FILE__, __LINE__); abort();}}
|
|
|
|
#define fb_assert_continue(ex) {if (!(ex)) {gds__log (FB_GDS_ASSERT_FAILURE_STRING, __FILE__, __LINE__);}}
|
2001-12-24 03:51:06 +01:00
|
|
|
|
|
|
|
#else // !SUPERSERVER
|
|
|
|
|
2004-04-29 00:36:29 +02:00
|
|
|
#define fb_assert(ex) {if (!(ex)) {fprintf (stderr, FB_GDS_ASSERT_FAILURE_STRING, __FILE__, __LINE__); abort();}}
|
|
|
|
#define fb_assert_continue(ex) {if (!(ex)) {fprintf (stderr, FB_GDS_ASSERT_FAILURE_STRING, __FILE__, __LINE__);}}
|
2001-12-24 03:51:06 +01:00
|
|
|
|
|
|
|
#endif // SUPERSERVER
|
|
|
|
|
|
|
|
#else // DEV_BUILD
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2003-03-04 04:42:23 +01:00
|
|
|
#define fb_assert(ex) // nothing
|
2003-11-04 00:59:24 +01:00
|
|
|
#define fb_assert_continue(ex) // nothing
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2003-03-04 04:42:23 +01:00
|
|
|
#endif // DEV_BUILD
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2003-03-04 04:42:23 +01:00
|
|
|
#endif // JRD_GDSASSERT_H
|