From dfbfd65ab33a1439fcb5496a50a3130e51d306bd Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Mon, 28 Jun 2021 20:29:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8F=E5=AE=9A=E4=B9=89=E7=A7=BB=E8=87=B3ma?= =?UTF-8?q?cros.h=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/config.h | 29 +---------------------------- src/Common/macros.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/src/Common/config.h b/src/Common/config.h index 36abf90d..1a22cf81 100644 --- a/src/Common/config.h +++ b/src/Common/config.h @@ -16,38 +16,11 @@ #include "Util/mini.h" #include "Util/onceToken.h" #include "Util/NoticeCenter.h" +#include "macros.h" using namespace std; using namespace toolkit; -#ifndef CHECK -#define CHECK(exp) Assert_Throw(!(exp), #exp, __FUNCTION__, __FILE__, __LINE__) -#endif//CHECK - -#ifndef MAX -#define MAX(a,b) ((a) > (b) ? (a) : (b) ) -#endif //MAX - -#ifndef MIN -#define MIN(a,b) ((a) < (b) ? (a) : (b) ) -#endif //MIN - -#ifndef CLEAR_ARR -#define CLEAR_ARR(arr) for(auto &item : arr){ item = 0;} -#endif //CLEAR_ARR - -#define SERVER_NAME "ZLMediaKit-5.0(build in " __DATE__ " " __TIME__ ")" -#define VHOST_KEY "vhost" -#define HTTP_SCHEMA "http" -#define RTSP_SCHEMA "rtsp" -#define RTMP_SCHEMA "rtmp" -#define HLS_SCHEMA "hls" -#define TS_SCHEMA "ts" -#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 { //加载配置文件,如果配置文件不存在,那么会导出默认配置并生成配置文件 diff --git a/src/Common/macros.h b/src/Common/macros.h index 27cce249..8f3ead22 100644 --- a/src/Common/macros.h +++ b/src/Common/macros.h @@ -37,5 +37,38 @@ #endif //!defined(_WIN32) #endif +#ifndef CHECK +#define CHECK(exp) Assert_Throw(!(exp), #exp, __FUNCTION__, __FILE__, __LINE__) +#endif//CHECK + +#ifndef MAX +#define MAX(a,b) ((a) > (b) ? (a) : (b) ) +#endif //MAX + +#ifndef MIN +#define MIN(a,b) ((a) < (b) ? (a) : (b) ) +#endif //MIN + +#ifndef CLEAR_ARR +#define CLEAR_ARR(arr) for(auto &item : arr){ item = 0;} +#endif //CLEAR_ARR + +#define SERVER_NAME "ZLMediaKit-5.0(build in " __DATE__ " " __TIME__ ")" +#define VHOST_KEY "vhost" +#define HTTP_SCHEMA "http" +#define RTSP_SCHEMA "rtsp" +#define RTMP_SCHEMA "rtmp" +#define HLS_SCHEMA "hls" +#define TS_SCHEMA "ts" +#define FMP4_SCHEMA "fmp4" +#define DEFAULT_VHOST "__defaultVhost__" + +#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 #endif //ZLMEDIAKIT_MACROS_H