mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[libc] Fix noreturn c++ compatibility
Stop using bare "noreturn" with library functions, and use the more cross-compatible "_Noreturn" instead.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
noreturn void
|
||||
void
|
||||
__assert_fail( const char *, const char *, unsigned, const char * )
|
||||
{
|
||||
// TODO: display message
|
||||
|
||||
@@ -20,7 +20,7 @@ extern "C" {
|
||||
#define assert( argument ) ( (void) 0 )
|
||||
#else
|
||||
|
||||
noreturn void __assert_fail( const char *, const char *, unsigned, const char * );
|
||||
_Noreturn void __assert_fail( const char *, const char *, unsigned, const char * );
|
||||
|
||||
#define assert( argument ) \
|
||||
do { if (!(argument)) { __assert_fail( #argument, __FILE__, __LINE__, __func__ ); }} while(0)
|
||||
|
||||
@@ -10,10 +10,8 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define noreturn [[noreturn]]
|
||||
#elif __STDC_VERSION__ >= 201103L
|
||||
#if !defined(__cplusplus) && __STDC_VERSION__ >= 201103L
|
||||
#define noreturn _Noreturn
|
||||
#else
|
||||
#elif !defined(__cplusplus)
|
||||
#define noreturn
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user