title: How to include WinAPI without contaminating the rest of the code?
body: <p>I'm working on a library in C++ and a part of it is an abstraction layer of several OS functions that i need. I started implementing that with the Windows API but plan to add support for other platforms with #ifdef and such.</p>
  
  <p>What is however starting to become a problem is that including Windows.h propagates to the whole rest of the code where i don't need it and especially, as it is a library, it will also contaminate the code of other people that would use it. I wouldn't really mind if the Windows API used a namespace or some clear way to distinguish its code but instead they #define a lot of pretty common words such as small, near, far (lowercase) and a lot of the function names are also pretty general.</p>
  
  <p>So i would really like if only the platform specific part of my code had access to these and it wouldn't be included anywhere else. I know that the obvious solution would be to only include Windows.h in the CPP files but that isn't always possible because some of the platform specific data types or structures are class member variables such as:</p>
  
  <pre><code>class Window {
  
  public:
  
      // ...
  
  private:
      HWND handle;
  
  };
  </code></pre>
  
  <p>So is there a way to accomplish this?</p>
  
  <p>Thanks.</p>