Commit 0402646f by xiongziliang

防止命名空间歧义

parent 4505f8ff
ZLToolKit @ 40c09a48
Subproject commit b49676057e05bed1b43070c99bc4e541f2302526
Subproject commit 40c09a4865026de94cdc1ad874aeba580bf15fdf
......@@ -105,7 +105,7 @@ extern const std::string kBroadcastReloadConfig;
#define ReloadConfigTag ((void *)(0xFF))
#define RELOAD_KEY(arg,key) \
do { \
decltype(arg) arg##_tmp = toolkit::mINI::Instance()[key]; \
decltype(arg) arg##_tmp = ::toolkit::mINI::Instance()[key]; \
if (arg == arg##_tmp) { \
return; \
} \
......@@ -116,8 +116,8 @@ extern const std::string kBroadcastReloadConfig;
//监听某个配置发送变更
#define LISTEN_RELOAD_KEY(arg, key, ...) \
do { \
static toolkit::onceToken s_token_listen([](){ \
toolkit::NoticeCenter::Instance().addListener(ReloadConfigTag, \
static ::toolkit::onceToken s_token_listen([](){ \
::toolkit::NoticeCenter::Instance().addListener(ReloadConfigTag, \
Broadcast::kBroadcastReloadConfig,[](BroadcastReloadConfigArgs) { \
__VA_ARGS__; \
}); \
......@@ -125,7 +125,7 @@ extern const std::string kBroadcastReloadConfig;
} while(0)
#define GET_CONFIG(type, arg, key) \
static type arg = toolkit::mINI::Instance()[key]; \
static type arg = ::toolkit::mINI::Instance()[key]; \
LISTEN_RELOAD_KEY(arg, key, { \
RELOAD_KEY(arg, key); \
});
......@@ -133,9 +133,9 @@ extern const std::string kBroadcastReloadConfig;
#define GET_CONFIG_FUNC(type, arg, key, ...) \
static type arg; \
do { \
static toolkit::onceToken s_token_set([](){ \
static ::toolkit::onceToken s_token_set([](){ \
static auto lam = __VA_ARGS__ ; \
static auto arg##_str = toolkit::mINI::Instance()[key]; \
static auto arg##_str = ::toolkit::mINI::Instance()[key]; \
arg = lam(arg##_str); \
LISTEN_RELOAD_KEY(arg, key, { \
RELOAD_KEY(arg##_str, key); \
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论