diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2005-02-11 07:17:00 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2005-02-11 07:17:00 +0000 |
commit | ecb313cceeca1a6345ca7fcb89d015de48d3d507 (patch) | |
tree | e00de098dfbfc2304a8ecf6f49f5602565ae6ac8 /winsup/mingw/include/assert.h | |
parent | e2a12d9f7d2dd9513ee90f52634cf74e70514718 (diff) | |
download | cygnal-ecb313cceeca1a6345ca7fcb89d015de48d3d507.tar.gz cygnal-ecb313cceeca1a6345ca7fcb89d015de48d3d507.tar.bz2 cygnal-ecb313cceeca1a6345ca7fcb89d015de48d3d507.zip |
* include/assert.h; Remove header guard. undef assert macro.
(_assert): Use __MINGW_ATTRIB_NORETURN define.
Diffstat (limited to 'winsup/mingw/include/assert.h')
-rw-r--r-- | winsup/mingw/include/assert.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/winsup/mingw/include/assert.h b/winsup/mingw/include/assert.h index d33c9a8a7..9d825c9a2 100644 --- a/winsup/mingw/include/assert.h +++ b/winsup/mingw/include/assert.h @@ -8,20 +8,22 @@ * */ -#ifndef _ASSERT_H_ -#define _ASSERT_H_ +/* We should be able to include this file multiple times to allow the assert + macro to be enabled/disabled for different parts of code. So don't add a + header guard. */ + +#ifndef RC_INVOKED /* All the headers include this file. */ #include <_mingw.h> -#ifndef RC_INVOKED +#undef assert #ifdef __cplusplus extern "C" { #endif #ifdef NDEBUG - /* * If not debugging, assert does nothing. */ @@ -33,16 +35,13 @@ extern "C" { * CRTDLL nicely supplies a function which does the actual output and * call to abort. */ -_CRTIMP void __cdecl _assert (const char*, const char*, int) -#ifdef __GNUC__ - __attribute__ ((noreturn)) -#endif - ; +_CRTIMP void __cdecl _assert (const char*, const char*, int) __MINGW_ATTRIB_NORETURN; /* * Definition of the assert macro. */ #define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__)) + #endif /* NDEBUG */ #ifdef __cplusplus @@ -50,6 +49,3 @@ _CRTIMP void __cdecl _assert (const char*, const char*, int) #endif #endif /* Not RC_INVOKED */ - -#endif /* Not _ASSERT_H_ */ - |