Skip to content

Commit

Permalink
定义宏 DUI_DEPRECATED 用于将方法标记为已弃用,方便后期接口维护,当用户使用到被弃用的方法时,编译器将产生 warn 警告
Browse files Browse the repository at this point in the history
  • Loading branch information
atypiape committed Oct 15, 2016
1 parent f37d1ff commit a1e695f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions DuiLib/Core/UIDefine.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,18 @@ protected: \
{ DUI_MSGTYPE_TIMER, _T(""), DuiSig_vn,(DUI_PMSG)&OnTimer }, \


// Mark method as deprecated.
// example: DUI_DEPRECATED void func();
#if defined(_MSC_VER)
# define DUI_DEPRECATED __declspec(deprecated)
#elif defined(__GNUC__)
# define DUI_DEPRECATED __attribute__ ((deprecated))
#else
# pragma message("WARNING: You need to implement DUI_DEPRECATED for this compiler")
# define DUI_DEPRECATED
#endif


///
//////////////END消息映射宏定义////////////////////////////////////////////////////

Expand Down

0 comments on commit a1e695f

Please sign in to comment.