mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
防止release编译时第三方库断言不触发导致的崩溃 (#3617)
This commit is contained in:
parent
8159f4e085
commit
1695624732
@ -13,22 +13,18 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifdef assert
|
||||||
#ifdef assert
|
#undef assert
|
||||||
#undef assert
|
#endif//assert
|
||||||
#endif//assert
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
extern void Assert_Throw(int failed, const char *exp, const char *func, const char *file, int line, const char *str);
|
extern void Assert_Throw(int failed, const char *exp, const char *func, const char *file, int line, const char *str);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define assert(exp) Assert_Throw(!(exp), #exp, __FUNCTION__, __FILE__, __LINE__, NULL)
|
#define assert(exp) Assert_Throw(!(exp), #exp, __FUNCTION__, __FILE__, __LINE__, NULL)
|
||||||
#else
|
|
||||||
#define assert(e) ((void)0)
|
|
||||||
#endif//NDEBUG
|
|
||||||
|
|
||||||
#endif //ZLMEDIAKIT_ASSERT_H
|
#endif //ZLMEDIAKIT_ASSERT_H
|
||||||
|
Loading…
Reference in New Issue
Block a user