Morgan wrote a good article which discussed how debugger works. You can check
this entry here(This article is in Chinese ).
I noticed one code in Morgan’s comments:
#ifdef _DEBUG
#define LOG_INFO(format, str) do { printf(format, str); } while (0)
#else
#define LOG_INFO(format, str)
#endif
So, do you know why he use “do {} while (0)” instead of “{}” ?
Here’s the explanation:
do..while(0) […]
