i found this code from here
#if 1
#define rsAssert(v) do {if(!(v)) LOGE("rsAssert failed: %s, in %s at %i", #v, __FILE__, __LINE__);} while(0)
#else
#define rsAssert(v) while(0)
#endif
Question 1:
Here i am not getting why do and while
is used here? Is there any special reason for using this?
Question 2:
What is the purpose of doing this all in macro. Why just one dont use assert()
?
i think perhaps there is a valid reason for this..