diff options
Diffstat (limited to 'v4.0/src/TOOLS/BLD/INC/ASSERT.H')
| -rw-r--r-- | v4.0/src/TOOLS/BLD/INC/ASSERT.H | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/v4.0/src/TOOLS/BLD/INC/ASSERT.H b/v4.0/src/TOOLS/BLD/INC/ASSERT.H new file mode 100644 index 0000000..3a9809f --- /dev/null +++ b/v4.0/src/TOOLS/BLD/INC/ASSERT.H | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | /*** | ||
| 2 | *assert.h - define the assert macro | ||
| 3 | * | ||
| 4 | * Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved. | ||
| 5 | * | ||
| 6 | *Purpose: | ||
| 7 | * Defines the assert(exp) macro. | ||
| 8 | * [ANSI/System V] | ||
| 9 | * | ||
| 10 | *******************************************************************************/ | ||
| 11 | |||
| 12 | |||
| 13 | #ifndef _ASSERT_DEFINED | ||
| 14 | |||
| 15 | #ifndef NDEBUG | ||
| 16 | |||
| 17 | static char _assertstring[] = "Assertion failed: %s, file %s, line %d\n"; | ||
| 18 | |||
| 19 | #define assert(exp) { \ | ||
| 20 | if (!(exp)) { \ | ||
| 21 | fprintf(stderr, _assertstring, #exp, __FILE__, __LINE__); \ | ||
| 22 | fflush(stderr); \ | ||
| 23 | abort(); \ | ||
| 24 | } \ | ||
| 25 | } | ||
| 26 | |||
| 27 | #else | ||
| 28 | |||
| 29 | #define assert(exp) | ||
| 30 | |||
| 31 | #endif /* NDEBUG */ | ||
| 32 | |||
| 33 | #define _ASSERT_DEFINED | ||
| 34 | |||
| 35 | #endif /* _ASSERT_DEFINED */ | ||