title: How to identify platform/compiler from preprocessor macros?
body: <p>I'm writing a cross-platform code, which should compile at linux, windows, Mac OS. On windows, I must support visual studio and mingw.</p>
  
  <p>There are some pieces of platform-specific code, which I should place in <code>#ifdef .. #endif</code> environment. For example, here I placed win32 specific code:</p>
  
  <pre><code>#ifdef WIN32
  #include &lt;windows.h&gt;
  #endif
  </code></pre>
  
  <p>But how do I recognize linux and mac OS? What are defines names (or etc.) I should use?</p>