Check for STRINGIZE_VALUE_OF before defining it

This commit is contained in:
apio 2022-12-03 17:18:16 +01:00
parent 9c9cb6a05a
commit 3740309427

View File

@ -3,7 +3,9 @@
extern _noreturn bool __check_failed(const char* file, const char* line, const char* func, const char* expr); extern _noreturn bool __check_failed(const char* file, const char* line, const char* func, const char* expr);
#ifndef STRINGIZE_VALUE_OF
#define STRINGIZE(x) #x #define STRINGIZE(x) #x
#define STRINGIZE_VALUE_OF(x) STRINGIZE(x) #define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
#endif
#define check(expr) (expr) || __check_failed(__FILE__, STRINGIZE_VALUE_OF(__LINE__), __PRETTY_FUNCTION__, #expr) #define check(expr) (expr) || __check_failed(__FILE__, STRINGIZE_VALUE_OF(__LINE__), __PRETTY_FUNCTION__, #expr)