~ubuntu-branches/ubuntu/saucy/nspr/saucy-updates

« back to all changes in this revision

Viewing changes to mozilla/nsprpub/pr/src/md/mac/MacErrorHandling.h

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2009-08-10 11:34:26 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090810113426-3uv4diflrkcbdimm
Tags: 4.8-0ubuntu1
* New upstream release: 4.8 (LP: #387812)
* adjust patches to changed upstreanm codebase
  - update debian/patches/99_configure.patch
* update shlibs symbols to include new API elements
  - update debian/libnspr4-0d.symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* ***** BEGIN LICENSE BLOCK *****
2
 
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3
 
 *
4
 
 * The contents of this file are subject to the Mozilla Public License Version
5
 
 * 1.1 (the "License"); you may not use this file except in compliance with
6
 
 * the License. You may obtain a copy of the License at
7
 
 * http://www.mozilla.org/MPL/
8
 
 *
9
 
 * Software distributed under the License is distributed on an "AS IS" basis,
10
 
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
 
 * for the specific language governing rights and limitations under the
12
 
 * License.
13
 
 *
14
 
 * The Original Code is the Netscape Portable Runtime (NSPR).
15
 
 *
16
 
 * The Initial Developer of the Original Code is
17
 
 * Netscape Communications Corporation.
18
 
 * Portions created by the Initial Developer are Copyright (C) 1998-2000
19
 
 * the Initial Developer. All Rights Reserved.
20
 
 *
21
 
 * Contributor(s):
22
 
 *
23
 
 * Alternatively, the contents of this file may be used under the terms of
24
 
 * either the GNU General Public License Version 2 or later (the "GPL"), or
25
 
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26
 
 * in which case the provisions of the GPL or the LGPL are applicable instead
27
 
 * of those above. If you wish to allow use of your version of this file only
28
 
 * under the terms of either the GPL or the LGPL, and not to allow others to
29
 
 * use your version of this file under the terms of the MPL, indicate your
30
 
 * decision by deleting the provisions above and replace them with the notice
31
 
 * and other provisions required by the GPL or the LGPL. If you do not delete
32
 
 * the provisions above, a recipient may use your version of this file under
33
 
 * the terms of any one of the MPL, the GPL or the LGPL.
34
 
 *
35
 
 * ***** END LICENSE BLOCK ***** */
36
 
 
37
 
/*********************************************************************
38
 
 
39
 
FILENAME
40
 
        Exceptions.h
41
 
        
42
 
DESCRIPTION
43
 
        A collection of routines and macros to handle assertions and
44
 
        exceptions.
45
 
 
46
 
COPYRIGHT
47
 
        Copyright � Apple Computer, Inc. 1989-1991
48
 
        All rights reserved.
49
 
 
50
 
ROUTINES
51
 
        EXTERNALS
52
 
                dprintf
53
 
                check_dprintf
54
 
                checkpos_dprintf
55
 
 
56
 
MACROS
57
 
        EXTERNALS
58
 
                check
59
 
                ncheck
60
 
                check_action
61
 
                ncheck_action
62
 
                require
63
 
                nrequire
64
 
                require_action
65
 
                nrequire_action
66
 
                resume
67
 
 
68
 
MODIFICATION HISTORY
69
 
        Nov 12 95               BKJ             Moved to MetroWerks environment & the NSPR
70
 
                
71
 
NOTE
72
 
        To keep code size down, use these routines and macros with the C
73
 
        compiler option -b2 or -b3. This will eliminate duplicate strings
74
 
        within a procedure.
75
 
 
76
 
*********************************************************************/
77
 
 
78
 
#ifndef __MACERRORHANDLING__
79
 
#define __MACERRORHANDLING__
80
 
 
81
 
/*********************************************************************
82
 
 
83
 
INCLUDES
84
 
 
85
 
*********************************************************************/
86
 
 
87
 
#include        <Types.h>
88
 
 
89
 
/*<FF>*/
90
 
/*********************************************************************
91
 
 
92
 
CONSTANTS AND CONTROL
93
 
 
94
 
*********************************************************************/
95
 
 
96
 
/*
97
 
        These defines are used to control the amount of information
98
 
        displayed when an assertion fails. DEBUGOFF and WARN will run
99
 
        silently. MIN will simply break into the debugger. ON will break
100
 
        and display the assertion that failed and the exception (for
101
 
        require statements). FULL will also display the source file name
102
 
        and line number. SYM does a SysBreak and is usefull when using a
103
 
        symbolic debugger like SourceBug or SADE. They should be set into
104
 
        DEBUGLEVEL. The default LEVEL is OFF.
105
 
*/
106
 
 
107
 
#define DEBUGOFF                0
108
 
#define DEBUGWARN               1
109
 
#define DEBUGMIN                2
110
 
#define DEBUGON                 3
111
 
#define DEBUGFULL               4
112
 
#define DEBUGSYM                6
113
 
 
114
 
#ifndef DEBUGLEVEL
115
 
#define DEBUGLEVEL      DEBUGOFF
116
 
#endif  DEBUGLEVEL
117
 
 
118
 
/*
119
 
        resumeLabel is used to control the insertion of labels for use with
120
 
        the resume macro. If you do not use the resume macro and you wish
121
 
        to have multible exceptions per label then you can add the
122
 
        following define to you source code.
123
 
        
124
 
*/
125
 
#define resumeLabel(exception)                                                                                  // Multiple exceptions per label
126
 
// #define resumeLabel(exception)       resume_ ## exception:                           // Single exception per label
127
 
 
128
 
 
129
 
/*
130
 
        traceon and debugon are used to test for options
131
 
*/
132
 
 
133
 
#define traceon ((DEBUGLEVEL > DEBUGWARN) && defined(TRACEON))
134
 
#define debugon (DEBUGLEVEL > DEBUGWARN)
135
 
 
136
 
/*
137
 
        Add some macros for DEBUGMIN and DEBUGSYM to keep the size down.
138
 
*/
139
 
 
140
 
#define __DEBUGSMALL    ((DEBUGLEVEL == DEBUGMIN) ||                    \
141
 
                                                                 (DEBUGLEVEL == DEBUGSYM))
142
 
 
143
 
#if     DEBUGLEVEL == DEBUGMIN
144
 
#define __DebuggerBreak Debugger()
145
 
#elif   DEBUGLEVEL == DEBUGSYM
146
 
#define  __DebuggerBreak        SysBreak()
147
 
#endif
148
 
 
149
 
 
150
 
/*<FF>*/
151
 
/*********************************************************************
152
 
 
153
 
MACRO
154
 
        check(assertion)
155
 
 
156
 
DESCRIPTION
157
 
        If debugging is on then check will test assertion and if it fails
158
 
        break into the debugger. Otherwise check does nothing.
159
 
 
160
 
*********************************************************************/
161
 
 
162
 
#if     __DEBUGSMALL
163
 
 
164
 
#define check(assertion)                                                                                                                        \
165
 
        do {                                                                                                                                                    \
166
 
                if (assertion) ;                                                                                                                        \
167
 
                else __DebuggerBreak;                                                                                                           \
168
 
        } while (false)
169
 
 
170
 
#elif   DEBUGLEVEL == DEBUGON
171
 
 
172
 
#define check(assertion)                                                                                                                        \
173
 
        do {                                                                                                                                                    \
174
 
                if (assertion) ;                                                                                                                        \
175
 
                else {                                                                                                                                          \
176
 
                        dprintf(notrace, "Assertion \"%s\" Failed",     #assertion);                            \
177
 
                }                                                                                                                                                       \
178
 
        } while (false)
179
 
 
180
 
#elif   DEBUGLEVEL == DEBUGFULL
181
 
 
182
 
#define check(assertion)                                                                                                                        \
183
 
        do {                                                                                                                                                    \
184
 
                if (assertion) ;                                                                                                                        \
185
 
                else {                                                                                                                                          \
186
 
                        dprintf(notrace,        "Assertion \"%s\" Failed\n"                                                     \
187
 
                                                                        "File: %s\n"                                                                    \
188
 
                                                                        "Line: %d",                                                                             \
189
 
                                #assertion, __FILE__, __LINE__);                                                                        \
190
 
                }                                                                                                                                                       \
191
 
        } while (false)
192
 
        
193
 
#else
194
 
 
195
 
#define check(assertion)
196
 
 
197
 
#endif
198
 
 
199
 
/*<FF>*/
200
 
/*********************************************************************
201
 
 
202
 
MACRO
203
 
        ncheck(assertion)
204
 
 
205
 
DESCRIPTION
206
 
        If debugging is on then ncheck will test !assertion and if it fails
207
 
        break into the debugger. Otherwise ncheck does nothing.
208
 
 
209
 
*********************************************************************/
210
 
 
211
 
#if     __DEBUGSMALL
212
 
 
213
 
#define ncheck(assertion)                                                                                                       \
214
 
        do {                                                                                                                                    \
215
 
                if (assertion) __DebuggerBreak;                                                                         \
216
 
        } while (false)
217
 
 
218
 
#elif   DEBUGLEVEL == DEBUGON
219
 
 
220
 
#define ncheck(assertion)                                                                                                       \
221
 
        do {                                                                                                                                    \
222
 
                void*   __privateAssertion      = (void*)(assertion);                                   \
223
 
                                                                                                                                                        \
224
 
                if (__privateAssertion) {                                                                                       \
225
 
                        dprintf(notrace, "Assertion \"!(%s [= %#08X])\" Failed",                \
226
 
                                #assertion, __privateAssertion);                                                        \
227
 
                }                                                                                                                                       \
228
 
        } while (false)
229
 
 
230
 
#elif   DEBUGLEVEL == DEBUGFULL
231
 
 
232
 
#define ncheck(assertion)                                                                                                       \
233
 
        do {                                                                                                                                    \
234
 
                void*   __privateAssertion      = (void*)(assertion);                                   \
235
 
                                                                                                                                                        \
236
 
                if (__privateAssertion) {                                                                                       \
237
 
                        dprintf(notrace,        "Assertion \"!(%s [= %#08X])\" Failed\n"        \
238
 
                                                                        "File: %s\n"                                                    \
239
 
                                                                        "Line: %d",                                                             \
240
 
                        #assertion, __privateAssertion, __FILE__, __LINE__);                    \
241
 
                }                                                                                                                                       \
242
 
        } while (false)
243
 
 
244
 
#else
245
 
 
246
 
#define ncheck(assertion)
247
 
 
248
 
#endif
249
 
 
250
 
/*<FF>*/
251
 
/*********************************************************************
252
 
 
253
 
MACRO
254
 
        check_action(assertion, action)
255
 
 
256
 
DESCRIPTION
257
 
        If debugging is on then check_action will test assertion and if it
258
 
        fails break into the debugger then execute action. Otherwise
259
 
        check_action does nothing.
260
 
        
261
 
*********************************************************************/
262
 
 
263
 
#if     __DEBUGSMALL
264
 
 
265
 
#define check_action(assertion, action)                                                                         \
266
 
        do {                                                                                                                                    \
267
 
                if (assertion) ;                                                                                                        \
268
 
                else {                                                                                                                          \
269
 
                        __DebuggerBreak;                                                                                                \
270
 
                        { action }                                                                                                              \
271
 
        } while (false)
272
 
 
273
 
#elif   DEBUGLEVEL == DEBUGON
274
 
 
275
 
#define check_action(assertion, action)                                                                         \
276
 
        do {                                                                                                                                    \
277
 
                if (assertion) ;                                                                                                        \
278
 
                else {                                                                                                                          \
279
 
                        dprintf(notrace, "Assertion \"%s\" Failed",     #assertion);            \
280
 
                        { action }                                                                                                              \
281
 
                }                                                                                                                                       \
282
 
        } while (false)
283
 
 
284
 
#elif   DEBUGLEVEL == DEBUGFULL
285
 
 
286
 
#define check_action(assertion, action)                                                                         \
287
 
        do {                                                                                                                                    \
288
 
                if (assertion) ;                                                                                                        \
289
 
                else {                                                                                                                          \
290
 
                        dprintf(notrace,        "Assertion \"%s\" Failed\n"                                     \
291
 
                                                                        "File: %s\n"                                                    \
292
 
                                                                        "Line: %d",                                                             \
293
 
                                #assertion, __FILE__, __LINE__);                                                        \
294
 
                        { action }                                                                                                              \
295
 
                }                                                                                                                                       \
296
 
        } while (false)
297
 
 
298
 
#else
299
 
 
300
 
#define check_action(assertion, action)
301
 
 
302
 
#endif
303
 
 
304
 
/*<FF>*/
305
 
/**************************************************************************************
306
 
 
307
 
MACRO
308
 
        ncheck_action(assertion, action)
309
 
 
310
 
DESCRIPTION
311
 
        If debugging is on then ncheck_action will test !assertion and if
312
 
        it fails break into the debugger then execute action. Otherwise
313
 
        ncheck_action does nothing.
314
 
 
315
 
*********************************************************************/
316
 
 
317
 
#if     __DEBUGSMALL
318
 
 
319
 
#define ncheck_action(assertion, action)                                                                        \
320
 
        do {                                                                                                                                    \
321
 
                if (assertion) {                                                                                                        \
322
 
                        __DebuggerBreak;                                                                                                \
323
 
                        { action }                                                                                                              \
324
 
                }                                                                                                                                       \
325
 
        } while (false)
326
 
 
327
 
#elif   DEBUGLEVEL == DEBUGON
328
 
 
329
 
#define ncheck_action(assertion, action)                                                                        \
330
 
        do {                                                                                                                                    \
331
 
                void*   __privateAssertion      = (void*)(assertion);                                   \
332
 
                                                                                                                                                        \
333
 
                if (__privateAssertion) {                                                                                       \
334
 
                        dprintf(notrace, "Assertion \"!(%s [= %#08X])\" Failed",                \
335
 
                                #assertion, __privateAssertion);                                                        \
336
 
                        { action }                                                                                                              \
337
 
                }                                                                                                                                       \
338
 
        } while (false)
339
 
 
340
 
#elif DEBUGLEVEL == DEBUGFULL
341
 
 
342
 
#define ncheck_action(assertion, action)                                                                        \
343
 
        do {                                                                                                                                    \
344
 
                void*   __privateAssertion      = (void*)(assertion);                                   \
345
 
                                                                                                                                                        \
346
 
                if (__privateAssertion) {                                                                                       \
347
 
                        dprintf(notrace,        "Assertion \"!(%s [= %#08X])\" Failed\n"        \
348
 
                                                                        "File: %s\n"                                                    \
349
 
                                                                        "Line: %d",                                                             \
350
 
                        #assertion, __privateAssertion, __FILE__, __LINE__);                    \
351
 
                        { action }                                                                                                              \
352
 
                }                                                                                                                                       \
353
 
        } while (false)
354
 
 
355
 
#else
356
 
 
357
 
#define ncheck_action(assertion, action)
358
 
 
359
 
#endif
360
 
 
361
 
/*<FF>*/
362
 
/*********************************************************************
363
 
 
364
 
MACRO
365
 
        require(assertion, exception)
366
 
 
367
 
DESCRIPTION
368
 
        require will test assertion and if it fails:
369
 
                break into the debugger if debugging is on.
370
 
                goto exception.
371
 
 
372
 
*********************************************************************/
373
 
 
374
 
#if     __DEBUGSMALL
375
 
 
376
 
#define require(assertion, exception)                                                                           \
377
 
        do {                                                                                                                                    \
378
 
                if (assertion) ;                                                                                                        \
379
 
                else {                                                                                                                          \
380
 
                        __DebuggerBreak;                                                                                                \
381
 
                        goto exception;                                                                                                 \
382
 
                        resumeLabel(exception);                                                                                 \
383
 
                }                                                                                                                                       \
384
 
        } while (false)
385
 
 
386
 
#elif   DEBUGLEVEL == DEBUGON
387
 
 
388
 
#define require(assertion, exception)                                                                           \
389
 
        do {                                                                                                                                    \
390
 
                if (assertion) ;                                                                                                        \
391
 
                else {                                                                                                                          \
392
 
                        dprintf(notrace,        "Assertion \"%s\" Failed\n"                                     \
393
 
                                                                        "Exception \"%s\" Raised",                              \
394
 
                        #assertion, #exception);                                                                                \
395
 
                        goto exception;                                                                                                 \
396
 
                        resumeLabel(exception);                                                                                 \
397
 
                }                                                                                                                                       \
398
 
        } while (false)
399
 
 
400
 
#elif DEBUGLEVEL == DEBUGFULL
401
 
 
402
 
#define require(assertion, exception)                                                                           \
403
 
        do {                                                                                                                                    \
404
 
                if (assertion) ;                                                                                                        \
405
 
                else {                                                                                                                          \
406
 
                        dprintf(notrace,        "Assertion \"%s\" Failed\n"                                     \
407
 
                                                                        "Exception \"%s\" Raised\n"                             \
408
 
                                                                        "File: %s\n"                                                    \
409
 
                                                                        "Line: %d",                                                             \
410
 
                                #assertion, #exception, __FILE__, __LINE__);                            \
411
 
                        goto exception;                                                                                                 \
412
 
                        resumeLabel(exception);                                                                                 \
413
 
                }                                                                                                                                       \
414
 
        } while (false)
415
 
 
416
 
#else
417
 
 
418
 
#define require(assertion, exception)                                                                           \
419
 
        do {                                                                                                                                    \
420
 
                if (assertion) ;                                                                                                        \
421
 
                else {                                                                                                                          \
422
 
                        goto exception;                                                                                                 \
423
 
                        resumeLabel(exception);                                                                                 \
424
 
                }                                                                                                                                       \
425
 
        } while (false)
426
 
 
427
 
#endif
428
 
 
429
 
/*<FF>*/
430
 
/*********************************************************************
431
 
 
432
 
MACRO
433
 
        nrequire(assertion, exception)
434
 
 
435
 
DESCRIPTION
436
 
        nrequire will test !assertion and if it fails:
437
 
                break into the debugger if debugging is on.
438
 
                goto exception.
439
 
 
440
 
*********************************************************************/
441
 
 
442
 
#if     __DEBUGSMALL
443
 
 
444
 
#define nrequire(assertion, exception)                                                                          \
445
 
        do {                                                                                                                                    \
446
 
                if (assertion) {                                                                                                        \
447
 
                        DebugStr();                                                                                                             \
448
 
                        goto exception;                                                                                                 \
449
 
                        resumeLabel(exception);                                                                                 \
450
 
                }                                                                                                                                       \
451
 
        } while (false)
452
 
 
453
 
#elif   DEBUGLEVEL == DEBUGON
454
 
 
455
 
#define nrequire(assertion, exception)                                                                          \
456
 
        do {                                                                                                                                    \
457
 
                void*   __privateAssertion      = (void*)(assertion);                                   \
458
 
                                                                                                                                                        \
459
 
                if (__privateAssertion) {                                                                                       \
460
 
                        dprintf(notrace,        "Assertion \"!(%s [= %#08X])\" Failed\n"        \
461
 
                                                                        "Exception \"%s\" Raised",                              \
462
 
                                #assertion, __privateAssertion, #exception);                            \
463
 
                        goto exception;                                                                                                 \
464
 
                        resumeLabel(exception);                                                                                 \
465
 
                }                                                                                                                                       \
466
 
        } while (false)
467
 
 
468
 
#elif DEBUGLEVEL == DEBUGFULL
469
 
 
470
 
#define nrequire(assertion, exception)                                                                          \
471
 
        do {                                                                                                                                    \
472
 
                void*   __privateAssertion      = (void*)(assertion);                                   \
473
 
                                                                                                                                                        \
474
 
                if (__privateAssertion) {                                                                                       \
475
 
                        dprintf(notrace,        "Assertion \"!(%s [= %#08X])\" Failed\n"        \
476
 
                                                                        "Exception \"%s\" Raised\n"                             \
477
 
                                                                        "File: %s\n"                                                    \
478
 
                                                                        "Line: %d",                                                             \
479
 
                                #assertion, __privateAssertion, #exception, __FILE__,           \
480
 
                                __LINE__);                                                                                                      \
481
 
                        goto exception;                                                                                                 \
482
 
                        resumeLabel(exception);                                                                                 \
483
 
                }                                                                                                                                       \
484
 
        } while (false)
485
 
 
486
 
#else
487
 
 
488
 
#define nrequire(assertion, exception)                                                                          \
489
 
        do {                                                                                                                                    \
490
 
                if (assertion) {                                                                                                        \
491
 
                        goto exception;                                                                                                 \
492
 
                        resumeLabel(exception);                                                                                 \
493
 
                }                                                                                                                                       \
494
 
        } while (false)
495
 
 
496
 
#endif
497
 
 
498
 
/*<FF>*/
499
 
/*********************************************************************
500
 
 
501
 
MACRO
502
 
        require_action(assertion, exception, action)
503
 
 
504
 
DESCRIPTION
505
 
        require_action will test assertion and if it fails:
506
 
                break into the debugger if debugging is on.
507
 
                execute action.
508
 
                goto exception.
509
 
 
510
 
*********************************************************************/
511
 
 
512
 
#if     __DEBUGSMALL
513
 
 
514
 
#define require_action(assertion, exception, action)                                            \
515
 
        do {                                                                                                                                    \
516
 
                if (assertion) ;                                                                                                        \
517
 
                else {                                                                                                                          \
518
 
                        __DebuggerBreak;                                                                                                \
519
 
                        { action }                                                                                                              \
520
 
                        goto exception;                                                                                                 \
521
 
                        resumeLabel(exception);                                                                                 \
522
 
                }                                                                                                                                       \
523
 
        } while (false)
524
 
 
525
 
#elif   DEBUGLEVEL == DEBUGON
526
 
 
527
 
#define require_action(assertion, exception, action)                                            \
528
 
        do {                                                                                                                                    \
529
 
                if (assertion) ;                                                                                                        \
530
 
                else {                                                                                                                          \
531
 
                        dprintf(notrace,        "Assertion \"%s\" Failed\n"                                     \
532
 
                                                                        "Exception \"%s\" Raised",                              \
533
 
                        #assertion, #exception);                                                                                \
534
 
                        { action }                                                                                                              \
535
 
                        goto exception;                                                                                                 \
536
 
                        resumeLabel(exception);                                                                                 \
537
 
                }                                                                                                                                       \
538
 
        } while (false)
539
 
 
540
 
#elif DEBUGLEVEL == DEBUGFULL
541
 
 
542
 
#define require_action(assertion, exception, action)                                            \
543
 
        do {                                                                                                                                    \
544
 
                if (assertion) ;                                                                                                        \
545
 
                else {                                                                                                                          \
546
 
                        dprintf(notrace,        "Assertion \"%s\" Failed\n"                                     \
547
 
                                                                        "Exception \"%s\" Raised\n"                             \
548
 
                                                                        "File: %s\n"                                                    \
549
 
                                                                        "Line: %d",                                                             \
550
 
                                #assertion, #exception, __FILE__, __LINE__);                            \
551
 
                        { action }                                                                                                              \
552
 
                        goto exception;                                                                                                 \
553
 
                        resumeLabel(exception);                                                                                 \
554
 
                }                                                                                                                                       \
555
 
        } while (false)
556
 
 
557
 
#else
558
 
 
559
 
#define require_action(assertion, exception, action)                                            \
560
 
        do {                                                                                                                                    \
561
 
                if (assertion) ;                                                                                                        \
562
 
                else {                                                                                                                          \
563
 
                        { action }                                                                                                              \
564
 
                        goto exception;                                                                                                 \
565
 
                        resumeLabel(exception);                                                                                 \
566
 
                }                                                                                                                                       \
567
 
        } while (false)
568
 
 
569
 
#endif
570
 
 
571
 
/*<FF>*/
572
 
/*********************************************************************
573
 
 
574
 
MACRO
575
 
        nrequire_action(assertion, exception, action)
576
 
 
577
 
DESCRIPTION
578
 
        nrequire_action will test !assertion and if it fails:
579
 
                break into the debugger if debugging is on.
580
 
                execute action.
581
 
                goto exception.
582
 
 
583
 
*********************************************************************/
584
 
 
585
 
#if     __DEBUGSMALL
586
 
 
587
 
#define nrequire_action(assertion, exception, action)                                           \
588
 
        do {                                                                                                                                    \
589
 
                if (assertion) {                                                                                                        \
590
 
                        __DebuggerBreak;                                                                                                \
591
 
                        { action }                                                                                                              \
592
 
                        goto exception;                                                                                                 \
593
 
                        resumeLabel(exception);                                                                                 \
594
 
                }                                                                                                                                       \
595
 
        } while (false)
596
 
 
597
 
#elif DEBUGLEVEL == DEBUGON
598
 
 
599
 
#define nrequire_action(assertion, exception, action)                                           \
600
 
        do {                                                                                                                                    \
601
 
                void*   __privateAssertion      = (void*)(assertion);                                   \
602
 
                                                                                                                                                        \
603
 
                if (__privateAssertion) {                                                                                       \
604
 
                        dprintf(notrace,        "Assertion \"!(%s [= %#08X])\" Failed\n"        \
605
 
                                                                        "Exception \"%s\" Raised",                              \
606
 
                                #assertion, __privateAssertion, #exception);                            \
607
 
                        { action }                                                                                                              \
608
 
                        goto exception;                                                                                                 \
609
 
                        resumeLabel(exception);                                                                                 \
610
 
                }                                                                                                                                       \
611
 
        } while (false)
612
 
 
613
 
#elif DEBUGLEVEL == DEBUGFULL
614
 
 
615
 
#define nrequire_action(assertion, exception, action)                                           \
616
 
        do {                                                                                                                                    \
617
 
                void*   __privateAssertion      = (void*)(assertion);                                   \
618
 
                                                                                                                                                        \
619
 
                if (__privateAssertion) {                                                                                       \
620
 
                        dprintf(notrace,        "Assertion \"!(%s [= %#08X])\" Failed\n"        \
621
 
                                                                        "Exception \"%s\" Raised\n"                             \
622
 
                                                                        "File: %s\n"                                                    \
623
 
                                                                        "Line: %d",                                                             \
624
 
                                #assertion, __privateAssertion, #exception, __FILE__,           \
625
 
                                __LINE__);                                                                                                      \
626
 
                        { action }                                                                                                              \
627
 
                        goto exception;                                                                                                 \
628
 
                        resumeLabel(exception);                                                                                 \
629
 
                }                                                                                                                                       \
630
 
        } while (false)
631
 
 
632
 
#else
633
 
 
634
 
#define nrequire_action(assertion, exception, action)                                           \
635
 
        do {                                                                                                                                    \
636
 
                if (assertion) {                                                                                                        \
637
 
                        { action }                                                                                                              \
638
 
                        goto exception;                                                                                                 \
639
 
                        resumeLabel(exception);                                                                                 \
640
 
                }                                                                                                                                       \
641
 
        } while (false)
642
 
 
643
 
#endif
644
 
        
645
 
/*<FF>*/
646
 
/*********************************************************************
647
 
 
648
 
MACRO
649
 
        resume(exception)
650
 
 
651
 
DESCRIPTION
652
 
        resume will resume execution after the n/require/_action statement
653
 
        specified by exception. Resume lables must be on (the default) in
654
 
        order to use resume. If an action form of require was used then the
655
 
        action will not be re-executed.
656
 
 
657
 
*********************************************************************/
658
 
 
659
 
 
660
 
#define resume(exception)                                                                                                       \
661
 
        do {                                                                                                                                    \
662
 
                goto resume_ ## exception;                                                                                      \
663
 
        } while (false)
664
 
 
665
 
 
666
 
/*<FF>*/
667
 
/********************************************************************/
668
 
#endif