|
8 | 8 | * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
9 | 9 | * Portions Copyright (c) 1994, Regents of the University of California
|
10 | 10 | *
|
11 |
| - * $Id: c.h,v 1.66 2000/03/20 04:02:46 momjian Exp $ |
| 11 | + * $Id: c.h,v 1.67 2000/04/12 05:24:50 momjian Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -531,9 +531,11 @@ typedef struct Exception
|
531 | 531 | *
|
532 | 532 | */
|
533 | 533 | #define Trap(condition, exception) \
|
534 |
| - { if ((assert_enabled) && (condition)) \ |
| 534 | + do { \ |
| 535 | + if ((assert_enabled) && (condition)) \ |
535 | 536 | ExceptionalCondition(CppAsString(condition), &(exception), \
|
536 |
| - (char*)NULL, __FILE__, __LINE__); } |
| 537 | + (char*)NULL, __FILE__, __LINE__); \ |
| 538 | + } while (0) |
537 | 539 |
|
538 | 540 | /*
|
539 | 541 | * TrapMacro is the same as Trap but it's intended for use in macros:
|
@@ -577,9 +579,11 @@ extern int assert_enabled;
|
577 | 579 | *
|
578 | 580 | */
|
579 | 581 | #define LogTrap(condition, exception, printArgs) \
|
580 |
| - { if ((assert_enabled) && (condition)) \ |
| 582 | + do { \ |
| 583 | + if ((assert_enabled) && (condition)) \ |
581 | 584 | ExceptionalCondition(CppAsString(condition), &(exception), \
|
582 |
| - vararg_format printArgs, __FILE__, __LINE__); } |
| 585 | + vararg_format printArgs, __FILE__, __LINE__); \ |
| 586 | + } while (0) |
583 | 587 |
|
584 | 588 | /*
|
585 | 589 | * LogTrapMacro is the same as LogTrap but it's intended for use in macros:
|
|
0 commit comments