I saw a couple of form of assert in code on Windows,
Which one is the most correct to use? I saw people always define this to that, and I want to find the root one which is defined by Windows.
I also saw people manually define assert to NULL if macro DEBUG or _DEBUG is not defined, is that necessary?
I feel assert is in a mess and I want to find a clear and unified way for this item.
thanks in advance,
Here's a couple of links:
assert is defined to "nothing" when NDEBUG is set. It may be that NDEBUG isn't strictly connected with _DEBUG or DEBUG, which may explain the #if statements you see - or someone has had some buggy/strange implementation of assert.h (or wherever the ASSERT came from)
I don't like calling a "nothing" define NULL since it can be confused with the NULL that is used for pointers and such, or '\0' - empty is another option.