Mail Archives: djgpp-workers/1998/03/24/11:55:14
> I think that the C header(s) which define NULL should do so only under
> "#ifndef __cplusplus". It is safer to let C++ use its own definition
> throughout, and leave C at its usual definition.
No, that won't work, because C++ must accept ANSI as well, so the
following MUST be valid C++:
#include <stdio.h>
int main()
{
if (fopen("foo", "r") == NULL)
whatever();
}
DJGPP could be more careful about this, by #undef'ing NULL before
setting it (this always succeeds), but any other headers that screw
with the ANSI defined symbols are at fault if they conflict, because
ANSI says which headers define which symbols, not some third-party
library.
- Raw text -