Boost C++ Libraries: Ticket #9195: WinRT detection failed https://svn.boost.org/trac10/ticket/9195 <p> I have a normal desktop programm (using VS2012 &amp; Win7x64) but asio think it is a WinRT app (BOOST_ASIO_WINDOWS_RUNTIME is set). </p> <p> To fix this issue I have to update WinRT detection in boost\asio\detail\config.hpp line 458: </p> <pre class="wiki"># if (WINAPI_FAMILY == WINAPI_FAMILY_APP) </pre><p> instead of </p> <pre class="wiki"># if ((WINAPI_FAMILY &amp; WINAPI_PARTITION_APP) != 0) </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9195 Trac 1.4.3 chris_kohlhoff Thu, 03 Oct 2013 11:54:03 GMT <link>https://svn.boost.org/trac10/ticket/9195#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9195#comment:1</guid> <description> <p> I suspect the problem is even more complicated, because I also need to ensure the macros in winapifamily.h are defined ahead of the test. As that header is only available from the v8.0 sdk and later, I've enclosed that #include within a test for <code>__cplusplus_winrt</code>. </p> <p> Can you please try the following and let me know if it works for you: </p> <pre class="wiki">Index: config.hpp =================================================================== --- config.hpp (revision 86090) +++ config.hpp (working copy) @@ -454,11 +454,12 @@ // WinRT target. #if !defined(BOOST_ASIO_WINDOWS_RUNTIME) -# if defined(WINAPI_FAMILY) -# if ((WINAPI_FAMILY &amp; WINAPI_PARTITION_APP) != 0) +# if defined(__cplusplus_winrt) +# include &lt;winapifamily.h&gt; +# if WINAPI_FAMILY_ONE_PARTITION(WINAPI_FAMILY, WINAPI_PARTITION_APP) # define BOOST_ASIO_WINDOWS_RUNTIME 1 -# endif // ((WINAPI_FAMILY &amp; WINAPI_PARTITION_APP) != 0) -# endif // defined(WINAPI_FAMILY) +# endif // WINAPI_FAMILY_ONE_PARTITION(WINAPI_FAMILY, WINAPI_PARTITION_APP) +# endif // defined(__cplusplus_winrt) #endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME) // Windows target. Excludes WinRT. @@ -869,12 +870,12 @@ # endif // ((__GNUC__ == 3) &amp;&amp; (__GNUC_MINOR__ &gt;= 3)) || (__GNUC__ &gt; 3) # endif // defined(__GNUC__) &amp;&amp; (defined(__i386__) || defined(__x86_64__)) # endif // defined(__linux__) -# if defined(BOOST_ASIO_MSVC) &amp;&amp; defined(WINAPI_FAMILY) +# if defined(BOOST_ASIO_MSVC) &amp;&amp; defined(BOOST_ASIO_WINDOWS_RUNTIME) # if (_MSC_VER &gt;= 1700) # define BOOST_ASIO_HAS_THREAD_KEYWORD_EXTENSION 1 # define BOOST_ASIO_THREAD_KEYWORD __declspec(thread) # endif // (_MSC_VER &gt;= 1700) -# endif // defined(BOOST_ASIO_MSVC) &amp;&amp; defined(WINAPI_FAMILY) +# endif // defined(BOOST_ASIO_MSVC) &amp;&amp; defined(BOOST_ASIO_WINDOWS_RUNTIME) #endif // !defined(BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION) #if !defined(BOOST_ASIO_THREAD_KEYWORD) # define BOOST_ASIO_THREAD_KEYWORD __thread </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 03 Oct 2013 16:25:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9195#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9195#comment:2</guid> <description> <p> Your code is working for me. Thanks! </p> </description> <category>Ticket</category> </item> <item> <author>ramesh.502@…</author> <pubDate>Wed, 30 Oct 2013 12:07:51 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9195#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9195#comment:3</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/9195#comment:2" title="Comment 2">anonymous</a>: </p> <blockquote class="citation"> <p> Your code is working for me. Thanks! </p> </blockquote> <p> Hi, I want to use the BOOST lib for WINRT.Can you please help me how to get code for WINRT windows 8. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Mon, 05 May 2014 07:26:49 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9195#comment:4 https://svn.boost.org/trac10/ticket/9195#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Was fixed for boost 1.55 in <a class="changeset" href="https://svn.boost.org/trac10/changeset/86152" title="Fix WinRT detection.">r86152</a>. </p> Ticket