~ubuntu-branches/ubuntu/karmic/firebird2.1/karmic

« back to all changes in this revision

Viewing changes to src/jrd/gdsassert.h

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov
  • Date: 2008-05-26 23:59:25 UTC
  • Revision ID: james.westby@ubuntu.com-20080526235925-2pnqj6nxpppoeaer
Tags: upstream-2.1.0.17798-0.ds2
ImportĀ upstreamĀ versionĀ 2.1.0.17798-0.ds2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * The contents of this file are subject to the Interbase Public
 
3
 * License Version 1.0 (the "License"); you may not use this file
 
4
 * except in compliance with the License. You may obtain a copy
 
5
 * of the License at http://www.Inprise.com/IPL.html
 
6
 *
 
7
 * Software distributed under the License is distributed on an
 
8
 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
 
9
 * or implied. See the License for the specific language governing
 
10
 * rights and limitations under the License.
 
11
 *
 
12
 * The Original Code was created by Inprise Corporation
 
13
 * and its predecessors. Portions created by Inprise Corporation are
 
14
 * Copyright (C) Inprise Corporation.
 
15
 *
 
16
 * All Rights Reserved.
 
17
 * Contributor(s): ______________________________________.
 
18
 * CVC: Do not override local fb_assert like the ones in gpre and dsql.
 
19
 */
 
20
#ifndef JRD_GDSASSERT_H
 
21
#define JRD_GDSASSERT_H
 
22
 
 
23
 
 
24
#include "../jrd/gds_proto.h"
 
25
 
 
26
#ifdef DEV_BUILD
 
27
 
 
28
#include <stdlib.h>             // abort()
 
29
 
 
30
#include <stdio.h>
 
31
 
 
32
 
 
33
/* fb_assert() has been made into a generic version that works across
 
34
 * gds components.  Previously, the fb_assert() defined here was only
 
35
 * usable within the engine.
 
36
 * 1996-Feb-09 David Schnepper 
 
37
 */
 
38
 
 
39
#define FB_GDS_ASSERT_FAILURE_STRING    "GDS Assertion failure: %s %"LINEFORMAT"\n"
 
40
 
 
41
#ifdef SUPERSERVER
 
42
 
 
43
#if !defined(fb_assert)
 
44
#define fb_assert(ex)   {if (!(ex)) {gds__log (FB_GDS_ASSERT_FAILURE_STRING, __FILE__, __LINE__); abort();}}
 
45
#define fb_assert_continue(ex)  {if (!(ex)) {gds__log (FB_GDS_ASSERT_FAILURE_STRING, __FILE__, __LINE__);}}
 
46
#endif
 
47
 
 
48
#else   // !SUPERSERVER
 
49
 
 
50
#if !defined(fb_assert)
 
51
#define fb_assert(ex)   {if (!(ex)) {fprintf (stderr, FB_GDS_ASSERT_FAILURE_STRING, __FILE__, __LINE__); abort();}}
 
52
#define fb_assert_continue(ex)  {if (!(ex)) {fprintf (stderr, FB_GDS_ASSERT_FAILURE_STRING, __FILE__, __LINE__);}}
 
53
#endif
 
54
 
 
55
#endif  // SUPERSERVER
 
56
 
 
57
#else   // DEV_BUILD
 
58
 
 
59
#define fb_assert(ex)                           // nothing 
 
60
#define fb_assert_continue(ex)          // nothing 
 
61
 
 
62
#endif // DEV_BUILD 
 
63
 
 
64
#endif // JRD_GDSASSERT_H 
 
65