mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 22:20:01 +08:00
Progress toward clean SDCC compilation
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@18 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+40
-14
@@ -53,21 +53,42 @@
|
||||
#undef ASSERTCODE
|
||||
#undef DEBUGASSERT
|
||||
|
||||
#define ASSERT(f) \
|
||||
{ if (!(f)) up_assert((const ubyte *)__FILE__, (uint32)__LINE__); }
|
||||
#ifdef __GNUC__
|
||||
|
||||
#define ASSERTCODE(f, errCode) \
|
||||
{ if (!(f)) up_assert_code((const ubyte *)__FILE__, (uint32)__LINE__, errCode); }
|
||||
# define ASSERT(f) \
|
||||
{ if (!(f)) up_assert((const ubyte *)__FILE__, (int)__LINE__); }
|
||||
|
||||
# define ASSERTCODE(f, errCode) \
|
||||
{ if (!(f)) up_assert_code((const ubyte *)__FILE__, (int)__LINE__, errCode); }
|
||||
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define DEBUGASSERT(f) \
|
||||
{ if (!(f)) up_assert((const ubyte *)__FILE__, (int)__LINE__); }
|
||||
# else
|
||||
# define DEBUGASSERT(f)
|
||||
# endif /* CONFIG_DEBUG */
|
||||
|
||||
# define PANIC(errCode) \
|
||||
up_assert_code((const ubyte *)__FILE__, (int)__LINE__, (errCode)|0x8000)
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
#define DEBUGASSERT(f) \
|
||||
{ if (!(f)) up_assert((const ubyte *)__FILE__, (uint32)__LINE__); }
|
||||
#else
|
||||
#define DEBUGASSERT(f)
|
||||
#endif /* CONFIG_DEBUG */
|
||||
# define ASSERT(f) \
|
||||
{ if (!(f)) up_assert(); }
|
||||
|
||||
#define PANIC(errCode) \
|
||||
up_assert_code((const ubyte *)__FILE__, (uint32)__LINE__, ((errCode)|(0x8000)))
|
||||
# define ASSERTCODE(f, errCode) \
|
||||
{ if (!(f)) up_assert_code(errCode); }
|
||||
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define DEBUGASSERT(f) \
|
||||
{ if (!(f)) up_assert(); }
|
||||
# else
|
||||
# define DEBUGASSERT(f)
|
||||
# endif /* CONFIG_DEBUG */
|
||||
|
||||
# define PANIC(errCode) \
|
||||
up_assert_code((errCode)|0x8000)
|
||||
|
||||
#endif
|
||||
|
||||
/************************************************************
|
||||
* Included Files
|
||||
@@ -84,9 +105,14 @@ extern "C" {
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
EXTERN void up_assert(const ubyte *fileName, uint32 lineNum);
|
||||
EXTERN void up_assert_code(const ubyte *fileName, uint32 lineNum,
|
||||
uint16 errorCode);
|
||||
#ifdef __GNUC__
|
||||
EXTERN void up_assert(const ubyte *fileName, int lineNum);
|
||||
EXTERN void up_assert_code(const ubyte *fileName, int lineNum,
|
||||
int error_code);
|
||||
#else
|
||||
EXTERN void up_assert(void);
|
||||
EXTERN void up_assert_code(int error_code);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user