mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
664 B
35 lines
664 B
/***
|
|
*assert.h - define the assert macro
|
|
*
|
|
* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
|
|
*
|
|
*Purpose:
|
|
* Defines the assert(exp) macro.
|
|
* [ANSI/System V]
|
|
*
|
|
*******************************************************************************/
|
|
|
|
|
|
#ifndef _ASSERT_DEFINED
|
|
|
|
#ifndef NDEBUG
|
|
|
|
static char _assertstring[] = "Assertion failed: %s, file %s, line %d\n";
|
|
|
|
#define assert(exp) { \
|
|
if (!(exp)) { \
|
|
fprintf(stderr, _assertstring, #exp, __FILE__, __LINE__); \
|
|
fflush(stderr); \
|
|
abort(); \
|
|
} \
|
|
}
|
|
|
|
#else
|
|
|
|
#define assert(exp)
|
|
|
|
#endif /* NDEBUG */
|
|
|
|
#define _ASSERT_DEFINED
|
|
|
|
#endif /* _ASSERT_DEFINED */
|