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