summaryrefslogtreecommitdiff
path: root/v4.0/src/TOOLS/BLD/INC/ASSERT.H
diff options
context:
space:
mode:
authorGravatar Mark Zbikowski2024-04-25 21:24:10 +0100
committerGravatar Microsoft Open Source2024-04-25 22:32:27 +0000
commit2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch)
tree80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/TOOLS/BLD/INC/ASSERT.H
parentMerge pull request #430 from jpbaltazar/typoptbr (diff)
downloadms-dos-main.tar.gz
ms-dos-main.tar.xz
ms-dos-main.zip
MZ is back!HEADmain
Diffstat (limited to 'v4.0/src/TOOLS/BLD/INC/ASSERT.H')
-rw-r--r--v4.0/src/TOOLS/BLD/INC/ASSERT.H35
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
17static 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 */