**Basically, I have the DLog command in my project, i have almost hundreds of them. No i am building a release build and i want the compiler to ignore all my DLogs. One way i think of is go to every line where this DLog is and put an if condition only DLog
if(Debug) {DLog(.....)}
I am wondering is there a one place i can make the compiler ignore all these DLogs for release?**
Where you defined the DLog add an compiler directive :
#ifndef DLog
# ifdef DEBUG
# define DLog(...) NSLog(__VA_ARGS__)
# else
# define DLog( ...)
# endif // NDEBUG
#endif // DLog
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.