整理宏

This commit is contained in:
ziyue 2021-06-28 20:12:07 +08:00
parent 7e5873d818
commit 397c1c7c57
3 changed files with 24 additions and 20 deletions

View File

@ -13,22 +13,20 @@
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
extern void Assert_Throw(int failed, const char *exp, const char *func, const char *file, int line);
#ifdef __cplusplus
}
#endif
#define CHECK(exp) Assert_Throw(!(exp), #exp, __FUNCTION__, __FILE__, __LINE__)
#ifndef NDEBUG
#ifdef assert
#undef assert
#endif//assert
#define assert(exp) Assert_Throw(!(exp), #exp, __FUNCTION__, __FILE__, __LINE__);
#ifdef __cplusplus
extern "C" {
#endif
extern void Assert_Throw(int failed, const char *exp, const char *func, const char *file, int line);
#ifdef __cplusplus
}
#endif
#define assert(exp) Assert_Throw(!(exp), #exp, __FUNCTION__, __FILE__, __LINE__)
#else
#define assert(e) ((void)0)
#endif//NDEBUG

View File

@ -20,15 +20,10 @@
using namespace std;
using namespace toolkit;
namespace mediakit {
#ifndef CHECK
#define CHECK(exp) Assert_Throw(!(exp), #exp, __FUNCTION__, __FILE__, __LINE__)
#endif//CHECK
//加载配置文件,如果配置文件不存在,那么会导出默认配置并生成配置文件
//加载配置文件成功后会触发kBroadcastUpdateConfig广播
//如果指定的文件名(ini_path)为空,那么会加载默认配置文件
//默认配置文件名为 /path/to/your/exe.ini
//加载配置文件成功后返回true否则返回false
bool loadIniConfig(const char *ini_path = nullptr);
////////////其他宏定义///////////
#ifndef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b) )
#endif //MAX
@ -51,6 +46,17 @@ bool loadIniConfig(const char *ini_path = nullptr);
#define FMP4_SCHEMA "fmp4"
#define DEFAULT_VHOST "__defaultVhost__"
extern "C" void Assert_Throw(int failed, const char *exp, const char *func, const char *file, int line);
namespace mediakit {
//加载配置文件,如果配置文件不存在,那么会导出默认配置并生成配置文件
//加载配置文件成功后会触发kBroadcastUpdateConfig广播
//如果指定的文件名(ini_path)为空,那么会加载默认配置文件
//默认配置文件名为 /path/to/your/exe.ini
//加载配置文件成功后返回true否则返回false
bool loadIniConfig(const char *ini_path = nullptr);
////////////广播名称///////////
namespace Broadcast {

View File

@ -12,7 +12,7 @@
#define ZLMEDIAKIT_RTCPFCI_H
#include "Rtcp.h"
#include "assert.h"
#include "Common/config.h"
namespace mediakit {