From ecb313cceeca1a6345ca7fcb89d015de48d3d507 Mon Sep 17 00:00:00 2001 From: Danny Smith Date: Fri, 11 Feb 2005 07:17:00 +0000 Subject: [PATCH] * include/assert.h; Remove header guard. undef assert macro. (_assert): Use __MINGW_ATTRIB_NORETURN define. --- winsup/mingw/ChangeLog | 5 +++++ winsup/mingw/include/assert.h | 20 ++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index 00d36d677..8b5d15f54 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,8 @@ +2005-02-11 Danny Smith + + * include/assert.h; Remove header guard. #undef assert macro. + (_assert): Use __MINGW_ATTRIB_NORETURN define. + 2005-02-11 Gregory W. Chicares Danny Smith 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_ */ -