I’m going absolutely nuts here. I’m doing some C++ development on Windows and I have a namespace named ‘interface’:
namespace gd {
namespace interface {
}} // end namespace
However, there is a file named “objbase.h” that gets included no matter if I include “Windows.h” or “Wtypes.h”, which contains a macro named ‘interface’. This macro won’t allow me to use the namespace name. Is there a feature in the Win32 API to disable the definition of the interface macro? If not, can someone think of a clever workaround to disabling it, without requiring too many mass changes in my code base?
If you really want to do this, you could
#undeftheinterfacemacro.I’d suggest, rather, not naming your namespace
interface, sinceinterfaceis as close to being a reserved word as you can get without actually being a reserved word. It’s going to cause a great deal of confusion to have that namespace in use.