CRT design bug?
Posted: Sat Jun 07, 2008 5:45 am
In the CRT article, you define NULL as follows:
If I'm not mistaken, you define NULL twice in C mode.
I would have expected it to be more like:
Plain and simple. Also, no need to wrap it in extern "C" as there aren't any symbols being declared.
Code: Select all
#ifdef __cplusplus
extern "C"
{
#endif
/* standard NULL declaration */
#define NULL 0 // <- This happens unconditionally!
#ifdef __cplusplus
}
#else
/* standard NULL declaration */
#define NULL (void*)0
#endif
I would have expected it to be more like:
Code: Select all
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void*)0)
#endif