Consider the followng situation:
MacFont.h
struct MacFont : Font
{
// ...
NSFont* font;
};
MacFont will be implemented in MacFont.mm
FontEngine.cpp:
#if defined(OS_MAC)
#include "MacFont.h"
#elif
// ...
#endif
//...
In order to make it compiling, I should rename FontEngine.cpp to FontEngine.mm but I’m not allowed to.
So what now?
If you cannot change the filename, don’t fret. Consult your compiler manual for an option to force the filetype, and tell the compiler that this file, regardless of extension, is an Objective-C++ file.