xgmsv/Source/Server_net/assertion_macros.h

14 lines
427 B
C
Raw Normal View History

2020-03-03 07:27:11 +08:00
//#pragma once
#if ENABLED(DEBUG_PROGRAM)
void assert_impl(char const* file, int line, char const* function, char const* message);
void assert_impl(char const* file, int line, char const* function, char const* message, char const* format, ...);
#ifdef assert
#undef assert
#endif
#define assert(cond, ...) { if (!(cond)) assert_impl(__FILE__, __LINE__, __FUNCTION__, #cond, ##__VA_ARGS__); }
#else
#define assert(...)
#endif