windows-nt/Source/XPSP1/NT/base/mvdm/dos/v86/h/assert.h

36 lines
664 B
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
/***
*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 */