mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-11-05 02:07:22 +00:00
08dbe1eea3
This is required by C99 and later, enabled by the availability of __func__. This requires an updated assertion-printing function in ORCALib. Unfortunately, GNO has the assertion-printing function in its libc rather than in ORCALib, because it calls the GNO implementation of stdio. Therefore, we continue to use the old form under GNO for now, to maintain compatibility with its existing libc.
36 lines
823 B
C
36 lines
823 B
C
/****************************************************************
|
|
*
|
|
* assert.h - debugging facilities
|
|
*
|
|
* February 1989
|
|
* Mike Westerfield
|
|
*
|
|
* Copyright 1989,1990, 1996
|
|
* Byte Works, Inc.
|
|
*
|
|
****************************************************************/
|
|
|
|
#ifdef assert
|
|
#undef assert
|
|
#endif
|
|
|
|
#ifndef NDEBUG
|
|
#ifndef __GNO__
|
|
#define assert(expression) (expression) ? ((void) 0) : (__assert2(__FILE__, __LINE__, __func__, #expression))
|
|
#else
|
|
#define assert(expression) (expression) ? ((void) 0) : (__assert(__FILE__, __LINE__, #expression))
|
|
#endif
|
|
#else
|
|
#define assert(expression) ((void)0)
|
|
#endif
|
|
|
|
#ifndef __assert__
|
|
#define __assert__
|
|
|
|
extern void __assert(const char *, unsigned, const char *);
|
|
extern void __assert2(const char *, unsigned, const char *, const char *);
|
|
|
|
#define static_assert _Static_assert
|
|
|
|
#endif
|