Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.0.14 更新日志 #27

Open
xaoxuu opened this issue Aug 16, 2017 · 0 comments
Open

0.0.14 更新日志 #27

xaoxuu opened this issue Aug 16, 2017 · 0 comments

Comments

@xaoxuu
Copy link
Owner

xaoxuu commented Aug 16, 2017

#if DEBUG的简单封装

函数很简单,能够提供一点便利,毕竟函数的调用比写宏更加快捷而且不易出错。

声明:

/**
 只在debug模式下运行的函数
 
 @param debug debug操作
 */
FOUNDATION_EXTERN void ax_debug_only(void (^debug)());

实现:

inline void ax_debug_only(void (^debug)()){
#ifdef DEBUG
    if (debug) {
        debug();
    }
#endif
}
@xaoxuu xaoxuu changed the title #if DEBUG的简单封装 0.0.14 更新日志 Aug 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant