Boost C++ Libraries: Ticket #7516: Define endianity for ARM https://svn.boost.org/trac10/ticket/7516 <p> There are two cases here. </p> <ol><li>GCC and Clang define <code>__ARMEL__</code> on little-endian ARM and <code>__ARMEB__</code> on big-endian ARM, so if either is defined, use it. </li><li>Visual C++ for WinCE target (not sure about ARM version of Win8 yet) however does not define absolutely anything specific. It defines <code>__ARM__</code> and <code>ARM</code>, but that might be defined in other compilers on big-endian too and <code>_M_ARM</code> one would expect in analogy to <code>_M_X64</code> and similar is <strong>not</strong> defined. However there are no big-endian Windows API implementations at all, so the attached patch simply defaults to little-endian if <code>_WIN32</code> is defined. </li></ol><p> Note: The attached patch is minimal to get things to work, but the various <code>_M_*</code> defines can probably be excluded from the condition if they get covered by <code>_WIN32</code>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7516 Trac 1.4.3 Jan Hudec <bulb@…> Wed, 17 Oct 2012 09:28:45 GMT attachment set https://svn.boost.org/trac10/ticket/7516 https://svn.boost.org/trac10/ticket/7516 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost.endian.arm.patch</span> </li> </ul> <p> Patch (-p1, non-tortoise) fixing endianity detection for WinCE (and Windows 8 for ARM, probably) </p> Ticket viboes Mon, 22 Oct 2012 17:30:41 GMT version changed; owner set https://svn.boost.org/trac10/ticket/7516#comment:1 https://svn.boost.org/trac10/ticket/7516#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">John Maddock</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.52.0</span> → <span class="trac-field-new">Boost 1.51.0</span> </li> </ul> <p> Which library are you using that makes use of this internal file? </p> <p> John, I've assigned this ticket to you as you are the last that updated the file. If you agree with the modification I could apply it myself. </p> Ticket John Maddock Mon, 22 Oct 2012 17:47:43 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7516#comment:2 https://svn.boost.org/trac10/ticket/7516#comment:2 <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> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/81047" title="Fix up for Arm. Fixes #7516.">[81047]</a>) Fix up for Arm. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7516" title="#7516: Patches: Define endianity for ARM (closed: fixed)">#7516</a>. </p> Ticket John Maddock Mon, 22 Oct 2012 18:12:53 GMT <link>https://svn.boost.org/trac10/ticket/7516#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7516#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/81048" title="Fix stray whitespace in previous commit. Refs #7516.">[81048]</a>) Fix stray whitespace in previous commit. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7516" title="#7516: Patches: Define endianity for ARM (closed: fixed)">#7516</a>. </p> </description> <category>Ticket</category> </item> <item> <author>Jan Hudec <bulb@…></author> <pubDate>Mon, 22 Oct 2012 19:25:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7516#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7516#comment:4</guid> <description> <blockquote class="citation"> <p> Which library are you using that makes use of this internal file? </p> </blockquote> <p> After update from 1.43 to 1.51 something in Boost.Test appears to have pulled it in. </p> <p> Thanks for fixing. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 09 Feb 2013 14:09:27 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7516#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7516#comment:5</guid> <description> <p> this change is not yet in 1.52.0. </p> <p> since i don't use glibc (first check, which would use endian.h), my armel device was not detected correctly. </p> <p> modern gcc's (iirc 4.4+) provide <code>__BYTE_ORDER__</code> so the code should do the following: </p> <pre class="wiki">#if defined(__GNUC__) &amp;&amp; defined(__BYTE_ORDER__) # if __BYTE_ORDER__ == __LITTLE_ENDIAN__ ... #elif defined(__GLIBC__) #include &lt;endian.h&gt; #else ... eternally incomplete cpu-specific ifdef hell here #endif </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 09 Feb 2013 14:17:30 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7516#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7516#comment:6</guid> <description> <p> btw, this file is used by something during compilation of boost. so using boost 1.52.0, linux with musl libc, and armel cpu, compilation of boost fails with an #error. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 09 Feb 2013 14:27:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7516#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7516#comment:7</guid> <description> <p> just tested, it's gcc 4.6+ that provides <code> __BYTE_ORDER__ </code> </p> </description> <category>Ticket</category> </item> </channel> </rss>