equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 1999 - 2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 /*************************************************************************** |
|
20 ** File: nwx_assert.h |
|
21 ** Purpose: Provides interfaces to support assertions in a platform |
|
22 ** independent manner. |
|
23 **************************************************************************/ |
|
24 #ifndef NWX_ASSERT_H |
|
25 #define NWX_ASSERT_H |
|
26 |
|
27 /* |
|
28 ** Includes |
|
29 */ |
|
30 #include "nwx_defs.h" |
|
31 |
|
32 #ifdef __cplusplus |
|
33 extern "C" { |
|
34 #endif |
|
35 |
|
36 /* |
|
37 ** Global Function Declarations |
|
38 */ |
|
39 |
|
40 |
|
41 |
|
42 #ifdef _DEBUG |
|
43 #if defined(__WINS__) |
|
44 // Debug builds use the _BREAKPOINT() macro provided by E32def.h |
|
45 // It provides complier-specific assembly instructions for Wins and WinsCW. |
|
46 // We use a function in the NW_ASSERT macro, because raw assembly generates a syntax error. |
|
47 int kimono_assert (void); |
|
48 #define NW_ASSERT(expr) (void)( (expr) || kimono_assert() ) |
|
49 #else /* THUMB */ |
|
50 #include <assert.h> |
|
51 #define NW_ASSERT(expr) assert(((NW_Uint32)(expr)) != 0) |
|
52 #endif // __WINS__ |
|
53 |
|
54 #else |
|
55 /* Release builds for all configurations evaluate to */ |
|
56 /* something the compiler optimizer can throw away. */ |
|
57 #define NW_ASSERT(expr) ((void)0) |
|
58 |
|
59 #endif |
|
60 |
|
61 |
|
62 |
|
63 #ifdef __cplusplus |
|
64 } /* extern "C" */ |
|
65 #endif |
|
66 |
|
67 #endif /* NWX_ASSERT_H */ |
|
68 |
|
69 |