pokeemerald/include/gba/isagbprint.h

51 lines
1.3 KiB
C
Raw Normal View History

2018-01-07 02:38:34 +00:00
#ifndef GUARD_GBA_ISAGBPRINT_H
#define GUARD_GBA_ISAGBPRINT_H
#ifdef NDEBUG
#define AGBPrintInit()
#define AGBPutc(cChr)
#define AGBPrint(pBuf)
2018-12-07 13:01:59 +00:00
#define AGBPrintf(pBuf, ...)
2018-01-07 02:38:34 +00:00
#define AGBPrintFlush1Block()
#define AGBPrintFlush()
#define AGBAssert(pFile, nLine, pExpression, nStopProgram)
#else
void AGBPrintInit(void);
void AGBPutc(const char cChr);
void AGBPrint(const char *pBuf);
void AGBPrintf(const char *pBuf, ...);
void AGBPrintFlush1Block(void);
void AGBPrintFlush(void);
void AGBAssert(const char *pFile, int nLine, const char *pExpression, int nStopProgram);
#endif
#undef AGB_ASSERT
#ifdef NDEBUG
2018-12-07 13:01:59 +00:00
#define AGB_ASSERT(exp)
2018-01-07 02:38:34 +00:00
#else
2018-12-07 13:01:59 +00:00
#define AGB_ASSERT(exp) (exp) ? ((void*)0) : AGBAssert(__FILE__, __LINE__, #exp, 1);
2018-01-07 02:38:34 +00:00
#endif
#undef AGB_WARNING
#ifdef NDEBUG
2018-12-07 13:01:59 +00:00
#define AGB_WARNING(exp)
2018-01-07 02:38:34 +00:00
#else
2018-12-07 13:01:59 +00:00
#define AGB_WARNING(exp) (exp) ? ((void*)0) : AGBAssert(__FILE__, __LINE__, #exp, 0);
2018-01-07 02:38:34 +00:00
#endif
// for matching purposes
#ifdef NDEBUG
2018-12-07 13:01:59 +00:00
#define AGB_ASSERT_EX(exp, file, line)
2018-01-07 02:38:34 +00:00
#else
2018-12-07 13:01:59 +00:00
#define AGB_ASSERT_EX(exp, file, line) (exp) ? ((void*)0) : AGBAssert(file, line, #exp, 1);
2018-01-07 02:38:34 +00:00
#endif
#ifdef NDEBUG
2018-12-07 13:01:59 +00:00
#define AGB_WARNING_EX(exp, file, line)
2018-01-07 02:38:34 +00:00
#else
2018-12-07 13:01:59 +00:00
#define AGB_WARNING_EX(exp, file, line) (exp) ? ((void*)0) : AGBAssert(file, line, #exp, 0);
2018-01-07 02:38:34 +00:00
#endif
#endif // GUARD_GBA_ISAGBPRINT_H