Saturday, September 20, 2008

Wrong macro

Here is how you shouldn't test for old compilers:

#if _MSC_VER < 1400
/* some workaround */
#endif


Reason: the workaround will also be applied to non-Microsoft compilers, e.g., gcc. Here is a more correct version:

#if defined(_MSC_VER) && _MSC_VER < 1400
/* some workaround */
#endif

No comments: