mirror of
https://github.com/boostorg/predef.git
synced 2025-07-30 03:47:14 +02:00
[tree] Fix some documentation typos. Add explanation of date to vnum decomposition.
git-svn-id: http://svn.boost.org/svn/boost/sandbox/predef@76967 b8fc166d-592f-0410-95f2-cb63ce0dd405
This commit is contained in:
@ -74,7 +74,13 @@ and "`0`" indicates an ignored decimal digit. Macros are:
|
||||
#define BOOST_PREDEF_MAKE_NN_NN_0_NNNN(V) BOOST_VERSION_NUMBER(((V)/10000000)%100,((V)/100000)%100,(V)%10000)
|
||||
/*` `BOOST_PREDEF_MAKE_NN_NN_00_NN_00(V)` */
|
||||
#define BOOST_PREDEF_MAKE_NN_NN_00_NN_00(V) BOOST_VERSION_NUMBER(((V)/100000000)%100,((V)/1000000)%100,((V)/100)%100)
|
||||
/*` `BOOST_PREDEF_MAKE_YYYY_MM_DD(V)` */
|
||||
/*`
|
||||
`BOOST_PREDEF_MAKE_YYYY_MM_DD(V)`
|
||||
|
||||
The date decomposition returns a date in the form
|
||||
`BOOST_VERSION_NUMBER(YYYY-1970,MM,DD)`. I.e. a date relative to the 1970
|
||||
Epoch date.
|
||||
*/
|
||||
#define BOOST_PREDEF_MAKE_YYYY_MM_DD(V) BOOST_VERSION_NUMBER(((V)/10000)%10000-1970,((V)/100)%100,(V)%100)
|
||||
|
||||
#endif
|
||||
|
@ -59,7 +59,7 @@
|
||||
</table></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"><p><small>Last revised: December 15, 2011 at 03:47:03 GMT</small></p></td>
|
||||
<td align="left"><p><small>Last revised: February 10, 2012 at 14:55:42 GMT</small></p></td>
|
||||
<td align="right"><div class="copyright-footer"></div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="using_the_predefs.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="section predef_adding_new_predefs">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="predef.adding_new_predefs"></a><a class="link" href="adding_new_predefs.html" title="Adding new predefs">Adding new predefs</a>
|
||||
</h2></div></div></div>
|
||||
@ -65,7 +65,7 @@
|
||||
if possible.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
If the detection must include a headers unconditionally, and has a choice
|
||||
If the detection must include headers unconditionally, and has a choice
|
||||
of headers to include, prefer the ones with the least impact. I.e. include
|
||||
the one with the minimal set of definitions and other dependencies.
|
||||
</li>
|
||||
@ -118,8 +118,8 @@ Documentation about what is detected.
|
||||
<p>
|
||||
Next is the detection and definition of the particular predef. The structure
|
||||
for this is to do a single overall check (<code class="computeroutput"><span class="identifier">condition_a</span></code>)
|
||||
and place the further version detection inside this. The first action inside
|
||||
the overall check is to "<code class="computeroutput"><span class="preprocessor">#undef</span>
|
||||
and place further version detection inside this. The first action inside the
|
||||
overall check is to "<code class="computeroutput"><span class="preprocessor">#undef</span>
|
||||
<span class="identifier">BOOST_category_tag</span></code>" which undefines
|
||||
the zero-value default. The rest is up to the you how to do the checks for
|
||||
defining the version. But at minimum it must "<code class="computeroutput"><span class="preprocessor">#define</span>
|
||||
@ -139,7 +139,7 @@ Documentation about what is detected.
|
||||
The testing of the predef macros is automated to generate checks for all the
|
||||
defined predefs, whether detected or not. To do this we need to declare the
|
||||
predef to the test system. This declaration is empty for regular use. And during
|
||||
the test programs theexpand out specially to create informational output:
|
||||
the test programs they expand out specially to create informational output:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">predef</span><span class="special">/</span><span class="identifier">detail</span><span class="special">/</span><span class="identifier">test</span><span class="special">.</span><span class="identifier">h</span><span class="special">></span>
|
||||
<span class="identifier">BOOST_PREDEF_DECLARE_TEST</span><span class="special">(</span><span class="identifier">BOOST_category_tag</span><span class="special">,</span><span class="string">"Name"</span><span class="special">)</span>
|
||||
@ -160,7 +160,7 @@ Documentation about what is detected.
|
||||
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">predef</span><span class="special">/</span><span class="identifier">make</span><span class="special">.</span><span class="identifier">h</span><span class="special">></span>
|
||||
</pre>
|
||||
<p>
|
||||
One will get a set utlity macros to decompose common version macros as defined
|
||||
One will get a set of utlity macros to decompose common version macros as defined
|
||||
by compilers. For example the EDG compiler uses a simple 3-digit version macro
|
||||
(M,N,P). It can be decomesed and defined as:
|
||||
</p>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="../index.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="using_the_predefs.html"><img src="../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="section predef_introduction">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="predef.introduction"></a><a class="link" href="introduction.html" title="Introduction">Introduction</a>
|
||||
</h2></div></div></div>
|
||||
@ -40,13 +40,12 @@
|
||||
the version number of boost itself).
|
||||
</li>
|
||||
<li class="listitem">
|
||||
A compiler identification macro, suitable for use in #if/#elif directives,
|
||||
for each of the supported compilers. All macros would be defined, regardless
|
||||
of the compiler. The one macro corresponding to the compiler being used
|
||||
would be defined, in terms of BOOST_VERSION_NUMBER, to carry the exact
|
||||
compiler version. All other macros would expand to an expression evaluating
|
||||
to false (for instance, the token 0) to indicate that the corresponding
|
||||
compiler is not present.
|
||||
A compiler identification macro, suitable for use in <code class="computeroutput"><span class="preprocessor">#if</span></code>/<code class="computeroutput"><span class="preprocessor">#elif</span></code> directives, for each of the supported
|
||||
compilers. All macros would be defined, regardless of the compiler. The
|
||||
one macro corresponding to the compiler being used would be defined, in
|
||||
terms of BOOST_VERSION_NUMBER, to carry the exact compiler version. All
|
||||
other macros would expand to an expression evaluating to false (for instance,
|
||||
the token 0) to indicate that the corresponding compiler is not present.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
"Null values" could be set, for all macros, in boost/config/select_compiler.hpp;
|
||||
@ -54,7 +53,6 @@
|
||||
#undef and re-#defined in the corresponding boost/compiler/(cc).hpp; however
|
||||
in the context of the Boost.Config infrastructure using a "prefix"
|
||||
header (to be introduced) or boost/config/suffix.hpp is a better solution.
|
||||
This point is further clarified later.
|
||||
</li>
|
||||
</ul></div>
|
||||
<h4>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="adding_new_predefs.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="section predef_reference">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="predef.reference"></a><a class="link" href="reference.html" title="Reference">Reference</a>
|
||||
</h2></div></div></div>
|
||||
@ -26,7 +26,7 @@
|
||||
<dt><span class="section"><a href="reference.html#predef.reference.version_definition_macros">Version definition
|
||||
macros</a></span></dt>
|
||||
</dl></div>
|
||||
<div class="section">
|
||||
<div class="section predef_reference_boost_architecture_architecture_">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="predef.reference.boost_architecture_architecture_"></a><a class="link" href="reference.html#predef.reference.boost_architecture_architecture_" title="BOOST_ARCHITECTURE_ architecture macros"><code class="computeroutput"><span class="identifier">BOOST_ARCHITECTURE_</span></code> architecture macros</a>
|
||||
</h3></div></div></div>
|
||||
@ -158,7 +158,7 @@
|
||||
architecture.
|
||||
</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="section predef_reference_boost_cxx_compiler_macros">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="predef.reference.boost_cxx_compiler_macros"></a><a class="link" href="reference.html#predef.reference.boost_cxx_compiler_macros" title="BOOST_CXX_ compiler macros"><code class="computeroutput"><span class="identifier">BOOST_CXX_</span></code> compiler macros</a>
|
||||
</h3></div></div></div>
|
||||
@ -403,7 +403,7 @@
|
||||
Version number available as major, and minor.
|
||||
</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="section predef_reference_boost_language_language_standard">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="predef.reference.boost_language_language_standard"></a><a class="link" href="reference.html#predef.reference.boost_language_language_standard" title="BOOST_LANGUAGE_ language standards macros"><code class="computeroutput"><span class="identifier">BOOST_LANGUAGE_</span></code> language standards macros</a>
|
||||
</h3></div></div></div>
|
||||
@ -549,7 +549,7 @@
|
||||
C++</a> language.
|
||||
</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="section predef_reference_boost_libc_and_boost_libstd_libr">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="predef.reference.boost_libc_and_boost_libstd_libr"></a><a class="link" href="reference.html#predef.reference.boost_libc_and_boost_libstd_libr" title="BOOST_LIBC_ and BOOST_LIBSTD_ library macros"><code class="computeroutput"><span class="identifier">BOOST_LIBC_</span></code> and <code class="computeroutput"><span class="identifier">BOOST_LIBSTD_</span></code>
|
||||
library macros</a>
|
||||
@ -667,7 +667,7 @@
|
||||
C++</a> library.
|
||||
</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="section predef_reference_boost_os_operating_system_macros">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="predef.reference.boost_os_operating_system_macros"></a><a class="link" href="reference.html#predef.reference.boost_os_operating_system_macros" title="BOOST_OS_ operating system macros"><code class="computeroutput"><span class="identifier">BOOST_OS_</span></code> operating system macros</a>
|
||||
</h3></div></div></div>
|
||||
@ -830,7 +830,7 @@
|
||||
Windows</a> operating system.
|
||||
</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="section predef_reference_version_definition_macros">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="predef.reference.version_definition_macros"></a><a class="link" href="reference.html#predef.reference.version_definition_macros" title="Version definition macros">Version definition
|
||||
macros</a>
|
||||
@ -964,6 +964,10 @@
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">BOOST_PREDEF_MAKE_YYYY_MM_DD</span><span class="special">(</span><span class="identifier">V</span><span class="special">)</span></code>
|
||||
</p>
|
||||
<p>
|
||||
The date decomposition returns a date in the form <code class="computeroutput"><span class="identifier">BOOST_VERSION_NUMBER</span><span class="special">(</span><span class="identifier">YYYY</span><span class="special">-</span><span class="number">1970</span><span class="special">,</span><span class="identifier">MM</span><span class="special">,</span><span class="identifier">DD</span><span class="special">)</span></code>.
|
||||
I.e. a date relative to the 1970 Epoch date.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="introduction.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="adding_new_predefs.html"><img src="../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="section predef_using_the_predefs">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="predef.using_the_predefs"></a><a class="link" href="using_the_predefs.html" title="Using the predefs">Using the predefs</a>
|
||||
</h2></div></div></div>
|
||||
@ -27,8 +27,8 @@
|
||||
This defines <span class="bold"><strong>all</strong></span> the version macros known
|
||||
to the library. For each macro it will be defined to either a <span class="emphasis"><em>zero</em></span>
|
||||
valued expression for when the particular item is not detected, and to a <span class="emphasis"><em>positive</em></span>
|
||||
value if it is detected. The predef macros fall onto the five categories each
|
||||
with macros of a particular prefix:
|
||||
value if it is detected. The predef macros fall onto five categories each with
|
||||
macros of a particular prefix:
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
@ -83,7 +83,7 @@
|
||||
</pre>
|
||||
<p>
|
||||
As you might notice above the <code class="computeroutput"><span class="keyword">else</span></code>
|
||||
clause also covers the case where we the particular compiler is not detected.
|
||||
clause also covers the case where the particular compiler is not detected.
|
||||
But one can make the test specifically test for the detection. All predef definitions
|
||||
are defined as a zero (0) expression when not detected. Hence one could use
|
||||
the detection with a natural single condition. For example:
|
||||
@ -153,7 +153,7 @@
|
||||
The ranges for each are "enforced" by the use of a modulo ("%"),
|
||||
i.e. truncation, as opposed to a clamp. And hence this means that the limits
|
||||
are enforced only enough to keep from having out-of-range problems. But not
|
||||
enough to prevent other kinds of problems. Like exceeding the range and geting
|
||||
enough to prevent other kinds of problems. Like exceeding the range and getting
|
||||
false detections, or non-detections. It is up to the individual predefs to
|
||||
ensure correct usage beyond the range guarantee.
|
||||
</p>
|
||||
|
@ -33,7 +33,7 @@ consistently represent their version. This includes:
|
||||
* A unique BOOST_VERSION_NUMBER(major,minor,patch) macro to specify version
|
||||
numbers (unfortunately, the name BOOST_VERSION is already taken to designate
|
||||
the version number of boost itself).
|
||||
* A compiler identification macro, suitable for use in #if/#elif directives,
|
||||
* A compiler identification macro, suitable for use in `#if`/`#elif` directives,
|
||||
for each of the supported compilers. All macros would be defined, regardless
|
||||
of the compiler. The one macro corresponding to the compiler being used would
|
||||
be defined, in terms of BOOST_VERSION_NUMBER, to carry the exact compiler
|
||||
@ -45,8 +45,7 @@ consistently represent their version. This includes:
|
||||
identification macro would be #undef and re-#defined in the corresponding
|
||||
boost/compiler/(cc).hpp; however in the context of the Boost.Config
|
||||
infrastructure using a "prefix" header (to be introduced) or
|
||||
boost/config/suffix.hpp is a better solution. This point is further
|
||||
clarified later.
|
||||
boost/config/suffix.hpp is a better solution.
|
||||
|
||||
[heading Current Library]
|
||||
|
||||
@ -131,7 +130,7 @@ single top-level header:
|
||||
This defines [*all] the version macros known to the library. For each
|
||||
macro it will be defined to either a /zero/ valued expression for when
|
||||
the particular item is not detected, and to a /positive/ value if it
|
||||
is detected. The predef macros fall onto the five categories each with
|
||||
is detected. The predef macros fall onto five categories each with
|
||||
macros of a particular prefix:
|
||||
|
||||
* `BOOST_ARCHITECTURE_`for system/CPU architecture one is compiling for.
|
||||
@ -164,7 +163,7 @@ a choice based on the version of the GCC C++ compiler one would:
|
||||
``
|
||||
|
||||
As you might notice above the `else` clause also covers the case where
|
||||
we the particular compiler is not detected. But one can make the test
|
||||
the particular compiler is not detected. But one can make the test
|
||||
specifically test for the detection. All predef definitions are defined
|
||||
as a zero (0) expression when not detected. Hence one could use the
|
||||
detection with a natural single condition. For example:
|
||||
@ -226,7 +225,7 @@ The arguments are:
|
||||
The ranges for each are "enforced" by the use of a modulo ("%"), i.e. truncation,
|
||||
as opposed to a clamp. And hence this means that the limits are enforced only
|
||||
enough to keep from having out-of-range problems. But not enough to prevent
|
||||
other kinds of problems. Like exceeding the range and geting false detections,
|
||||
other kinds of problems. Like exceeding the range and getting false detections,
|
||||
or non-detections. It is up to the individual predefs to ensure correct
|
||||
usage beyond the range guarantee.
|
||||
|
||||
@ -274,7 +273,7 @@ And there are some extra guidelines that predef headers should follow:
|
||||
not be included by default.
|
||||
* If the detection must include a header, prefer guarding it within the
|
||||
detection if possible.
|
||||
* If the detection must include a headers unconditionally, and has a choice
|
||||
* If the detection must include headers unconditionally, and has a choice
|
||||
of headers to include, prefer the ones with the least impact. I.e.
|
||||
include the one with the minimal set of definitions and other
|
||||
dependencies.
|
||||
@ -327,7 +326,7 @@ Documentation about what is detected.
|
||||
|
||||
Next is the detection and definition of the particular predef. The
|
||||
structure for this is to do a single overall check (`condition_a`) and
|
||||
place the further version detection inside this. The first action inside
|
||||
place further version detection inside this. The first action inside
|
||||
the overall check is to "`#undef BOOST_category_tag`" which undefines
|
||||
the zero-value default. The rest is up to the you how to do the checks
|
||||
for defining the version. But at minimum it must
|
||||
@ -348,7 +347,7 @@ to minimally indicate that the predef was detected:
|
||||
The testing of the predef macros is automated to generate checks for all
|
||||
the defined predefs, whether detected or not. To do this we need to
|
||||
declare the predef to the test system. This declaration is empty for
|
||||
regular use. And during the test programs theexpand out specially
|
||||
regular use. And during the test programs they expand out specially
|
||||
to create informational output:
|
||||
|
||||
``
|
||||
@ -370,7 +369,7 @@ By including:
|
||||
#include <boost/predef/make.h>
|
||||
``
|
||||
|
||||
One will get a set utlity macros to decompose common version
|
||||
One will get a set of utlity macros to decompose common version
|
||||
macros as defined by compilers. For example the EDG compiler
|
||||
uses a simple 3-digit version macro (M,N,P). It can be decomesed
|
||||
and defined as:
|
||||
|
Reference in New Issue
Block a user