title: Preprocessor definitions for Universal Windows Platform?
body: <p>We have a C++ library, and we received a few requests to support UWP. I'm investigating the port now. I'm looking through Microsoft's <a href="https://msdn.microsoft.com/en-us/library/b0084kay.aspx" rel="nofollow noreferrer">C/C++ Preprocessor Reference | Predefined Macros</a> for Visual Studio 2015, but I don't see anything related to UWP.</p>
  
  <p>I found <a href="https://msdn.microsoft.com/en-us/library/mt186162.aspx" rel="nofollow noreferrer">How to: Use Existing C++ Code in a Universal Windows Platform App</a>, but they look like the old defines for those Metro UI apps:</p>
  
  <ul>
  <li><code>WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PC_APP)</code></li>
  <li><code>WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)</code></li>
  <li><code>WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)</code></li>
  <li><code>WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)</code></li>
  </ul>
  
  <p>I'd expect to see something specific to the latest iteration of the Windows Runtime. I <em>thought</em> we might be able to detect Windows 10 and UWP via <code>_WIN32_WINNT_WIN10</code>, but there does <em>not</em> appears such a macro if I am parsing <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745%28v=vs.85%29.aspx#setting_winver_or__win32_winnt" rel="nofollow noreferrer">Using the Windows Headers</a> from MSDN correctly.</p>
  
  <p>Also <a href="https://stackoverflow.com/a/36963659/608639">some APIs are only available for Windows 10 and UWP Windows Store apps</a>, so we need to detect when some APIs are missing (i.e., Windows Phone 8, Windows Store 8, Windows 10, and Windows Store 10).</p>
  
  <p>What are the preprocessor macros used to detect UWP?</p>
  
  <hr>
  
  <p>A related question may be <a href="https://stackoverflow.com/q/36961152">Detect Windows Kit 8.0 and Windows Kit 8.1 SDKs</a>, but I'm not sure at the moment.</p>