NOUSER define in TestPlugIn.h

  • Hi there
    I just stumbled accross the preprocessor definitions in TestPlugIn.h because I wanted to use something from WinUser.h. Since TestPlugIn.h defines NOUSER before it includes windows.h, the functions from WinUser.h can only be used if windows.h is included before the cppunit headers.
    Is this behavior intended? Can somebody tell me what the reason for the NOUSER definition is? Performance?
    It just took me a while to figure out what was the reason that the WinUser.h functions could not be found and I figure that could have happened or will happen to others as well.

    Thanks and cheers,

  • Bitwise

    There are other NOxxx definitions made as well. I am not the original author but these are typically done for performance reasons.

    Really if you are compiling for the windows platform, the "#include <windows.h>" should be the first logical include in your header chain. Call it a workaround if you like, but that is what you should be doing anyhow.

    Last edit: Bitwise 2013-07-01
  • I don't like having include order dependent headers, but I have to agree with you, the system headers probably are a valid exception.
    Thanks for your reply.