mirror of
https://github.com/boostorg/predef.git
synced 2025-07-29 11:37:13 +02:00
Add WORD_BITS
predef detection.
fixes https://github.com/boostorg/predef/pull/107 fixes https://github.com/boostorg/predef/pull/108
This commit is contained in:
@ -14,6 +14,8 @@ http://www.boost.org/LICENSE_1_0.txt)
|
||||
* Fix including sub-BSD OS headers directly causing redef warnings.
|
||||
* Add CI testing of direct inclusion of all headers.
|
||||
* Add CI testing on FreeBSD for clang and gcc.
|
||||
* Add `WORD_BITS` set of predefs to detect the architecture word size.
|
||||
Initial implementation inspired by submission from Mikhail Komarov.
|
||||
|
||||
== 1.11
|
||||
|
||||
|
@ -693,8 +693,9 @@ pre.pygments .tok-il { color: #666666 } /* Literal.Number.Integer.Long */
|
||||
<li><a href="#_other_macros">4.8. Other macros</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#_boost_endian">4.8.1. <code>BOOST_ENDIAN_*</code></a></li>
|
||||
<li><a href="#_boost_predef_workaround">4.8.2. <code>BOOST_PREDEF_WORKAROUND</code></a></li>
|
||||
<li><a href="#_boost_predef_tested_at">4.8.3. <code>BOOST_PREDEF_TESTED_AT</code></a></li>
|
||||
<li><a href="#_boost_arch_word_bits">4.8.2. <code>BOOST_ARCH_WORD_BITS</code></a></li>
|
||||
<li><a href="#_boost_predef_workaround">4.8.3. <code>BOOST_PREDEF_WORKAROUND</code></a></li>
|
||||
<li><a href="#_boost_predef_tested_at">4.8.4. <code>BOOST_PREDEF_TESTED_AT</code></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_version_definition_macros">4.9. Version definition macros</a>
|
||||
@ -6390,7 +6391,43 @@ information and acquired knowledge:</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_boost_predef_workaround"><a class="anchor" href="#_boost_predef_workaround"></a>4.8.2. <code>BOOST_PREDEF_WORKAROUND</code></h4>
|
||||
<h4 id="_boost_arch_word_bits"><a class="anchor" href="#_boost_arch_word_bits"></a>4.8.2. <code>BOOST_ARCH_WORD_BITS</code></h4>
|
||||
<div class="paragraph">
|
||||
<p>Detects the native word size, in bits, for the current architecture. There are
|
||||
two types of macros for this detection:</p>
|
||||
</div>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>BOOST_ARCH_WORD_BITS</code>, gives the number of word size bits
|
||||
(16, 32, 64).</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>BOOST_ARCH_WORD_BITS_16</code>, <code>BOOST_ARCH_WORD_BITS_32</code>, and
|
||||
<code>BOOST_ARCH_WORD_BITS_64</code>, indicate when the given word size is
|
||||
detected.</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>They allow for both single checks and direct use of the size in code.</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<div class="title">ℹ</div>
|
||||
</td>
|
||||
<td class="content">
|
||||
The word size is determined manually on each architecture. Hence use of
|
||||
the <code>wordsize.h</code> header will also include all the architecture headers.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_boost_predef_workaround"><a class="anchor" href="#_boost_predef_workaround"></a>4.8.3. <code>BOOST_PREDEF_WORKAROUND</code></h4>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="pygments highlight"><code data-lang="cpp"><span></span><span class="tok-n">BOOST_PREDEF_WORKAROUND</span><span class="tok-p">(</span><span class="tok-n">symbol</span><span class="tok-p">,</span><span class="tok-n">comp</span><span class="tok-p">,</span><span class="tok-n">major</span><span class="tok-p">,</span><span class="tok-n">minor</span><span class="tok-p">,</span><span class="tok-n">patch</span><span class="tok-p">)</span></code></pre>
|
||||
@ -6416,7 +6453,7 @@ is undefine this expand to test the given <code>symbol</code> version value with
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_boost_predef_tested_at"><a class="anchor" href="#_boost_predef_tested_at"></a>4.8.3. <code>BOOST_PREDEF_TESTED_AT</code></h4>
|
||||
<h4 id="_boost_predef_tested_at"><a class="anchor" href="#_boost_predef_tested_at"></a>4.8.4. <code>BOOST_PREDEF_TESTED_AT</code></h4>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="pygments highlight"><code data-lang="cpp"><span></span><span class="tok-n">BOOST_PREDEF_TESTED_AT</span><span class="tok-p">(</span><span class="tok-n">symbol</span><span class="tok-p">,</span><span class="tok-n">major</span><span class="tok-p">,</span><span class="tok-n">minor</span><span class="tok-p">,</span><span class="tok-n">patch</span><span class="tok-p">)</span></code></pre>
|
||||
@ -6820,6 +6857,10 @@ expressions. It defaults to "c++", but can be any of: "c", "cpp",
|
||||
<li>
|
||||
<p>Add CI testing on FreeBSD for clang and gcc.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Add <code>WORD_BITS</code> set of predefs to detect the architecture word size.
|
||||
Initial implementation inspired by submission from Mikhail Komarov.</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -828,6 +828,8 @@ include::../include/boost/predef/hardware/simd/x86_amd/versions.h[tag=reference]
|
||||
|
||||
include::../include/boost/predef/other/endian.h[tag=reference]
|
||||
|
||||
include::../include/boost/predef/other/wordsize.h[tag=reference]
|
||||
|
||||
include::../include/boost/predef/other/workaround.h[tag=reference]
|
||||
|
||||
:leveloffset: -3
|
||||
|
@ -29,6 +29,5 @@ http://www.boost.org/LICENSE_1_0.txt)
|
||||
#include <boost/predef/architecture/sys390.h>
|
||||
#include <boost/predef/architecture/x86.h>
|
||||
#include <boost/predef/architecture/z.h>
|
||||
/*#include <boost/predef/architecture/.h>*/
|
||||
|
||||
#endif
|
||||
|
@ -52,6 +52,11 @@ http://en.wikipedia.org/wiki/DEC_Alpha[DEC Alpha] architecture.
|
||||
# define BOOST_ARCH_ALPHA_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_ALPHA
|
||||
# undef BOOST_ARCH_WORD_BITS_64
|
||||
# define BOOST_ARCH_WORD_BITS_64 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_ALPHA_NAME "DEC Alpha"
|
||||
|
||||
#endif
|
||||
|
@ -126,6 +126,16 @@ http://en.wikipedia.org/wiki/ARM_architecture[ARM] architecture.
|
||||
# define BOOST_ARCH_ARM_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_ARM
|
||||
# if BOOST_ARCH_ARM >= BOOST_VERSION_NUMBER(8,0,0)
|
||||
# undef BOOST_ARCH_WORD_BITS_64
|
||||
# define BOOST_ARCH_WORD_BITS_64 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
# else
|
||||
# undef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_ARM_NAME "ARM"
|
||||
|
||||
#endif
|
||||
|
@ -39,6 +39,11 @@ Blackfin Processors from Analog Devices.
|
||||
# define BOOST_ARCH_BLACKFIN_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_BLACKFIN
|
||||
# undef BOOST_ARCH_WORD_BITS_16
|
||||
# define BOOST_ARCH_WORD_BITS_16 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_BLACKFIN_NAME "Blackfin"
|
||||
|
||||
#endif
|
||||
|
@ -58,6 +58,11 @@ http://en.wikipedia.org/wiki/Convex_Computer[Convex Computer] architecture.
|
||||
# define BOOST_ARCH_CONVEX_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_CONVEX
|
||||
# undef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_CONVEX_NAME "Convex Computer"
|
||||
|
||||
#endif
|
||||
|
@ -42,6 +42,11 @@ http://en.wikipedia.org/wiki/Ia64[Intel Itanium 64] architecture.
|
||||
# define BOOST_ARCH_IA64_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_IA64
|
||||
# undef BOOST_ARCH_WORD_BITS_64
|
||||
# define BOOST_ARCH_WORD_BITS_64 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_IA64_NAME "Intel Itanium 64"
|
||||
|
||||
#endif
|
||||
|
@ -75,6 +75,11 @@ http://en.wikipedia.org/wiki/M68k[Motorola 68k] architecture.
|
||||
# define BOOST_ARCH_M68K_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_M68K
|
||||
# undef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_M68K_NAME "Motorola 68k"
|
||||
|
||||
#endif
|
||||
|
@ -66,6 +66,16 @@ http://en.wikipedia.org/wiki/MIPS_architecture[MIPS] architecture.
|
||||
# define BOOST_ARCH_MIPS_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_MIPS
|
||||
# if BOOST_ARCH_MIPS >= BOOST_VERSION_NUMBER(3,0,0)
|
||||
# undef BOOST_ARCH_WORD_BITS_64
|
||||
# define BOOST_ARCH_WORD_BITS_64 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
# else
|
||||
# undef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_MIPS_NAME "MIPS"
|
||||
|
||||
#endif
|
||||
|
@ -57,6 +57,11 @@ http://en.wikipedia.org/wiki/PA-RISC_family[HP/PA RISC] architecture.
|
||||
# define BOOST_ARCH_PARISC_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_PARISC
|
||||
# undef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_PARISC_NAME "HP/PA RISC"
|
||||
|
||||
#endif
|
||||
|
@ -65,6 +65,11 @@ http://en.wikipedia.org/wiki/PowerPC[PowerPC] architecture.
|
||||
# define BOOST_ARCH_PPC_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_PPC
|
||||
# undef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_PPC_NAME "PowerPC"
|
||||
|
||||
#endif
|
||||
|
@ -37,6 +37,11 @@ https://en.wikipedia.org/wiki/Parallel_Thread_Execution[PTX] architecture.
|
||||
# define BOOST_ARCH_PTX_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_PTX
|
||||
# undef BOOST_ARCH_WORD_BITS_64
|
||||
# define BOOST_ARCH_WORD_BITS_64 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_PTX_NAME "PTX"
|
||||
|
||||
#endif
|
||||
|
@ -35,6 +35,11 @@ Pyramid 9810 architecture.
|
||||
# define BOOST_ARCH_PYRAMID_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_PYRAMID
|
||||
# undef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_PYRAMID_NAME "Pyramid 9810"
|
||||
|
||||
#endif
|
||||
|
@ -35,6 +35,11 @@ http://en.wikipedia.org/wiki/RISC-V[RISC-V] architecture.
|
||||
# define BOOST_ARCH_RISCV_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_RISCV
|
||||
# undef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_RISCV_NAME "RISC-V"
|
||||
|
||||
#endif
|
||||
|
@ -41,6 +41,11 @@ http://en.wikipedia.org/wiki/RS/6000[RS/6000] architecture.
|
||||
# define BOOST_ARCH_RS6000_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_RS6000
|
||||
# undef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_RS6000_NAME "RS/6000"
|
||||
|
||||
#define BOOST_ARCH_PWR BOOST_ARCH_RS6000
|
||||
@ -49,6 +54,11 @@ http://en.wikipedia.org/wiki/RS/6000[RS/6000] architecture.
|
||||
# define BOOST_ARCH_PWR_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_PWR
|
||||
# undef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_PWR_NAME BOOST_ARCH_RS6000_NAME
|
||||
|
||||
#endif
|
||||
|
@ -47,6 +47,16 @@ http://en.wikipedia.org/wiki/SPARC[SPARC] architecture.
|
||||
# define BOOST_ARCH_SPARC_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_SPARC
|
||||
# if BOOST_ARCH_SPARC >= BOOST_VERSION_NUMBER(9,0,0)
|
||||
# undef BOOST_ARCH_WORD_BITS_64
|
||||
# define BOOST_ARCH_WORD_BITS_64 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
# else
|
||||
# undef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_SPARC_NAME "SPARC"
|
||||
|
||||
#endif
|
||||
|
@ -60,6 +60,19 @@ If available versions [1-5] are specifically detected.
|
||||
# define BOOST_ARCH_SH_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_SH
|
||||
# if BOOST_ARCH_SH >= BOOST_VERSION_NUMBER(5,0,0)
|
||||
# undef BOOST_ARCH_WORD_BITS_64
|
||||
# define BOOST_ARCH_WORD_BITS_64 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
# elif BOOST_ARCH_SH >= BOOST_VERSION_NUMBER(3,0,0)
|
||||
# undef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
# else
|
||||
# undef BOOST_ARCH_WORD_BITS_16
|
||||
# define BOOST_ARCH_WORD_BITS_16 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_SH_NAME "SuperH"
|
||||
|
||||
#endif
|
||||
|
@ -36,6 +36,11 @@ http://en.wikipedia.org/wiki/System/370[System/370] architecture.
|
||||
# define BOOST_ARCH_SYS370_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_SYS370
|
||||
# undef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_SYS370_NAME "System/370"
|
||||
|
||||
#endif
|
||||
|
@ -36,6 +36,11 @@ http://en.wikipedia.org/wiki/System/390[System/390] architecture.
|
||||
# define BOOST_ARCH_SYS390_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_SYS390
|
||||
# undef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_SYS390_NAME "System/390"
|
||||
|
||||
#endif
|
||||
|
@ -78,6 +78,11 @@ If available versions [3-6] are specifically detected.
|
||||
# define BOOST_ARCH_X86_32_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_X86_32
|
||||
# undef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_X86_32_NAME "Intel x86-32"
|
||||
|
||||
#include <boost/predef/architecture/x86.h>
|
||||
|
@ -41,6 +41,11 @@ http://en.wikipedia.org/wiki/Ia64[Intel IA-64] architecture.
|
||||
# define BOOST_ARCH_X86_64_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_X86_64
|
||||
# undef BOOST_ARCH_WORD_BITS_64
|
||||
# define BOOST_ARCH_WORD_BITS_64 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_X86_64_NAME "Intel x86-64"
|
||||
|
||||
#include <boost/predef/architecture/x86.h>
|
||||
|
@ -35,6 +35,11 @@ http://en.wikipedia.org/wiki/Z/Architecture[z/Architecture] architecture.
|
||||
# define BOOST_ARCH_Z_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_ARCH_Z
|
||||
# undef BOOST_ARCH_WORD_BITS_64
|
||||
# define BOOST_ARCH_WORD_BITS_64 BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_Z_NAME "z/Architecture"
|
||||
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright Rene Rivera 2013-2015
|
||||
Copyright Rene Ferdinand Rivera Morell 2013-2020
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -11,6 +11,7 @@ http://www.boost.org/LICENSE_1_0.txt)
|
||||
#endif
|
||||
|
||||
#include <boost/predef/other/endian.h>
|
||||
/*#include <boost/predef/other/.h>*/
|
||||
#include <boost/predef/other/wordsize.h>
|
||||
#include <boost/predef/other/workaround.h>
|
||||
|
||||
#endif
|
||||
|
@ -95,7 +95,7 @@ information and acquired knowledge:
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Built-in byte-swpped big-endian macros.
|
||||
/* Built-in byte-swapped big-endian macros.
|
||||
*/
|
||||
#if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
|
||||
!BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
|
||||
@ -112,7 +112,7 @@ information and acquired knowledge:
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Built-in byte-swpped little-endian macros.
|
||||
/* Built-in byte-swapped little-endian macros.
|
||||
*/
|
||||
#if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
|
||||
!BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
|
||||
@ -154,7 +154,7 @@ information and acquired knowledge:
|
||||
#endif
|
||||
|
||||
/* Windows on ARM, if not otherwise detected/specified, is always
|
||||
* byte-swaped little-endian.
|
||||
* byte-swapped little-endian.
|
||||
*/
|
||||
#if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
|
||||
!BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
|
||||
|
69
include/boost/predef/other/wordsize.h
Normal file
69
include/boost/predef/other/wordsize.h
Normal file
@ -0,0 +1,69 @@
|
||||
/*
|
||||
Copyright Rene Ferdinand Rivera Morell 2020
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef BOOST_PREDEF_OTHER_WORD_SIZE_H
|
||||
#define BOOST_PREDEF_OTHER_WORD_SIZE_H
|
||||
|
||||
#include <boost/predef/architecture.h>
|
||||
#include <boost/predef/version_number.h>
|
||||
#include <boost/predef/make.h>
|
||||
|
||||
/* tag::reference[]
|
||||
= `BOOST_ARCH_WORD_BITS`
|
||||
|
||||
Detects the native word size, in bits, for the current architecture. There are
|
||||
two types of macros for this detection:
|
||||
|
||||
* `BOOST_ARCH_WORD_BITS`, gives the number of word size bits
|
||||
(16, 32, 64).
|
||||
* `BOOST_ARCH_WORD_BITS_16`, `BOOST_ARCH_WORD_BITS_32`, and
|
||||
`BOOST_ARCH_WORD_BITS_64`, indicate when the given word size is
|
||||
detected.
|
||||
|
||||
They allow for both single checks and direct use of the size in code.
|
||||
|
||||
NOTE: The word size is determined manually on each architecture. Hence use of
|
||||
the `wordsize.h` header will also include all the architecture headers.
|
||||
|
||||
*/ // end::reference[]
|
||||
|
||||
#ifndef BOOST_ARCH_WORD_BITS_16
|
||||
# define BOOST_ARCH_WORD_BITS_16 BOOST_VERSION_NUMBER_NOT_AVAILABLE
|
||||
#else
|
||||
# define BOOST_ARCH_WORD_BITS 16
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_ARCH_WORD_BITS_32
|
||||
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_NOT_AVAILABLE
|
||||
#else
|
||||
# define BOOST_ARCH_WORD_BITS 32
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_ARCH_WORD_BITS_64
|
||||
# define BOOST_ARCH_WORD_BITS_64 BOOST_VERSION_NUMBER_NOT_AVAILABLE
|
||||
#else
|
||||
# define BOOST_ARCH_WORD_BITS 64
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_ARCH_WORD_BITS
|
||||
# define BOOST_ARCH_WORD_BITS 0
|
||||
#endif
|
||||
|
||||
#define BOOST_ARCH_WORD_BITS_16_NAME "16-bit Word Size"
|
||||
#define BOOST_ARCH_WORD_BITS_32_NAME "32-bit Word Size"
|
||||
#define BOOST_ARCH_WORD_BITS_64_NAME "64-bit Word Size"
|
||||
|
||||
#endif
|
||||
|
||||
#include <boost/predef/detail/test.h>
|
||||
BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_WORD_BITS_16,BOOST_ARCH_WORD_BITS_16_NAME)
|
||||
|
||||
#include <boost/predef/detail/test.h>
|
||||
BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_WORD_BITS_32,BOOST_ARCH_WORD_BITS_32_NAME)
|
||||
|
||||
#include <boost/predef/detail/test.h>
|
||||
BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_WORD_BITS_64,BOOST_ARCH_WORD_BITS_64_NAME)
|
@ -24,6 +24,5 @@ http://www.boost.org/LICENSE_1_0.txt)
|
||||
#include <boost/predef/platform/windows_system.h>
|
||||
#include <boost/predef/platform/windows_runtime.h> // deprecated
|
||||
#include <boost/predef/platform/ios.h>
|
||||
/*#include <boost/predef/platform/.h>*/
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user