Conflict with JUCE nullptr and noexcept macros


#1

To handle the case where some other headers define nullptr and noexcept before JUCE gets included, I think that juce_PlatformDefs.h should undefined these macros if they are already defined:

#ifdef nullptr
#undef nullptr
#endif
#ifdef noexcept
#undef noexcept
#endif
// define noexcept and nullptr

#2

Excellent idea, thanks Vinnie!


#3

…is there actually ever a need to check whether a macro is defined before undef-ing it?

I’ve always just undef-ed things without worrying about whether they were defined, and have never had any problems, but are there compilers that would complain about it?


#4

[quote=“jules”]…is there actually ever a need to check whether a macro is defined before undef-ing it?

I’ve always just undef-ed things without worrying about whether they were defined, and have never had any problems, but are there compilers that would complain about it?[/quote]

I haven’t seen an error but I’ve seen preprocessors emit a warning.