diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-04-08 03:09:47 +0000 |
---|---|---|
committer | <> | 2015-05-05 14:37:32 +0000 |
commit | f2541bb90af059680aa7036f315f052175999355 (patch) | |
tree | a5b214744b256f07e1dc2bd7273035a7808c659f /libs/predef | |
parent | ed232fdd34968697a68783b3195b1da4226915b5 (diff) | |
download | boost-tarball-master.tar.gz |
Imported from /home/lorry/working-area/delta_boost-tarball/boost_1_58_0.tar.bz2.HEADboost_1_58_0master
Diffstat (limited to 'libs/predef')
31 files changed, 671 insertions, 63 deletions
diff --git a/libs/predef/build.jam b/libs/predef/build.jam index aac15589c..5ee09afe2 100644 --- a/libs/predef/build.jam +++ b/libs/predef/build.jam @@ -3,7 +3,4 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -project predef - ; - path-constant BOOST_PREDEF_ROOT : . ; diff --git a/libs/predef/check/build.jam b/libs/predef/check/build.jam new file mode 100644 index 000000000..1ce4f11e9 --- /dev/null +++ b/libs/predef/check/build.jam @@ -0,0 +1,9 @@ +# Copyright Rene Rivera 2015 +# 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) + +exe predef_check_as_c : predef_check_as_c.c : <include>../include ; +exe predef_check_as_cpp : predef_check_as_cpp.cpp : <include>../include ; +exe predef_check_as_objc : predef_check_as_objc.m : <include>../include ; +exe predef_check_as_objcpp : predef_check_as_objcpp.mm : <include>../include ; diff --git a/libs/predef/check/predef.jam b/libs/predef/check/predef.jam new file mode 100644 index 000000000..0638703a0 --- /dev/null +++ b/libs/predef/check/predef.jam @@ -0,0 +1,106 @@ +# Copyright Rene Rivera 2015 +# 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) + +# Defines rules that provide requirements based on checking +# conditions using Boost Predef definitions and version numbers. + +import modules ; +import project ; +import feature ; +import string ; +import toolset ; +import modules ; +import path ; + +# Create a project for our targets. +project.extension predef check ; + +# Feature to pass check expressions to check programs. +feature.feature predef-expression : : free ; + +# Check programs. Each needs to be compiled for different languages +# even though they are all the same source code. +local rule check_target ( language : ext ) +{ + # Need to use absolute paths because we don't know the + # context of the invocation which affects where the paths + # originate from. + local predef_jam + = [ modules.binding $(__name__) ] ; + local source_path + = $(predef_jam:D)/predef_check_as_$(language).$(ext) ; + local include_path + = $(predef_jam:D)/../include ; + _check_exe_($(language)) = [ + exe predef_check_as_$(language) + : $(source_path) + : <include>$(include_path) ] ; + explicit predef_check_as_$(language) ; +} +check_target c : c ; +check_target cpp : cpp ; +check_target objc : m ; +check_target objcpp : mm ; + +# Checks the expressions and when used evaluates to the true-properties +# if the expressions are all true. Otherwise evaluates to the +# false-properties. +rule check ( expressions + : language ? : true-properties * : false-properties * ) +{ + # Default to C++ on the check context. + language ?= cpp ; + + local project_target = [ project.target $(__name__) ] ; + project.push-current $(project_target) ; + local result ; + for expression in $(expressions) + { + # The check program to use. + local exe_target = [ $(_check_exe_($(language))).name ] ; + exe_target = /check/predef//$(exe_target) ; + + # Create the check run if we don't have one yet. + local key = [ MD5 $(language)::$(expression) ] ; + if ! ( $(key) in $(_checks_) ) + { + _checks_ += $(key) ; + make + $(key).txt : + $(exe_target) : + @$(__name__).predef_check_action : + <predef-expression>$(expression) ; + explicit + $(key).txt ; + } + + local check_target = [ check-target-builds + /check/predef//$(key).txt $(expression) + : $(true-properties) + : $(false-properties) ] ; + + result += $(check_target) ; + } + project.pop-current ; + return $(result) ; +} + +# Checks the expressions and when used evaluates to <build>no +# if the expressions are all false. Otherwise evaluates to the +# nothing. +rule require ( expressions + : language ? ) +{ + return [ check $(expressions) : $(language) : : <build>no ] ; +} + +rule predef_check_action ( targets + : sources + : props * ) +{ + PREDEF_CHECK_EXPRESSION on $(targets) + = [ feature.get-values <predef-expression> : $(props) ] ; +} + +actions predef_check_action bind PREDEF_CHECK_EXPRESSION +{ + $(>) "$(PREDEF_CHECK_EXPRESSION)" > $(<) +} diff --git a/libs/predef/check/predef_check_as_c.c b/libs/predef/check/predef_check_as_c.c new file mode 100644 index 000000000..dcb7d6aa3 --- /dev/null +++ b/libs/predef/check/predef_check_as_c.c @@ -0,0 +1,119 @@ +/* +Copyright Rene Rivera 2011-2015 +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) +*/ +#include <string.h> +#include <stdio.h> +#include <stdlib.h> + +#define BOOST_PREDEF_INTERNAL_GENERATE_TESTS + +typedef struct predef_info +{ + unsigned tag; + const char * name; + const char * description; + unsigned value; +} predef_info; + +predef_info first_predef_info = { 0x43210DEF , "-" , "-" , 0xFFFFFFFF }; + +#define BOOST_PREDEF_DECLARE_TEST(x,s) \ + predef_info x##_predef_info = { 0x67890DEF , #x , s , x }; +#include <boost/predef.h> + +predef_info last_predef_info = { 0xFFFFFFFF , "-" , "-" , 0x43210DEF }; + +int predef_info_compare(const void * a, const void * b) +{ + const predef_info ** i = (const predef_info **)a; + const predef_info ** j = (const predef_info **)b; + return strcmp((*i)->name,(*j)->name); +} + +const char * str_token(const char ** str, const char * space) +{ + unsigned span; + char * token; + for (; **str != 0; *str += 1) + { + if (0 == strchr(space, **str)) + { + break; + } + } + span = strcspn(*str, space); + token = (char *)malloc(span+1); + strncpy(token, *str, span); + token[span] = 0; + for (*str += span; **str != 0; *str += 1) + { + if (0 == strchr(space, **str)) + { + break; + } + } + return token; +} + +const char * whitespace = " "; +const char * dot = "."; + +int main(int argc, const char ** argv) +{ + unsigned x = 0; + int argi = 1; + predef_info ** predefs = 0; + unsigned predef_count = 0; + unsigned * i = &first_predef_info.tag; + unsigned * e = &last_predef_info.tag; + while (i < e) + { + i += 1; + if (*i == 0x67890DEF) + { + predef_count += 1; + predefs = (predef_info**)realloc(predefs,predef_count*sizeof(predef_info*)); + predefs[predef_count-1] = (predef_info*)i; + } + } + qsort(predefs,predef_count,sizeof(predef_info*),predef_info_compare); + for (argi = 1; argi < argc; ++argi) + { + const char * exp = argv[argi]; + const char * exp_name = str_token(&exp, whitespace); + const char * exp_op = str_token(&exp, whitespace); + const char * exp_val = str_token(&exp, whitespace); + unsigned exp_version = 0; + if (*exp_val != 0) + { + exp = exp_val; + const char * exp_val_a = str_token(&exp, dot); + const char * exp_val_b = str_token(&exp, dot); + const char * exp_val_c = str_token(&exp, dot); + exp_version = BOOST_VERSION_NUMBER(atoi(exp_val_a), atoi(exp_val_b),atoi(exp_val_c)); + } + for (x = 0; x < predef_count; ++x) + { + if (*exp_op == 0 && + predefs[x]->value == 0 && + strcmp(exp_name, predefs[x]->name) == 0) + { + return argi; + } + else if (*exp_op != 0 && *exp_val != 0 && + strcmp(exp_name, predefs[x]->name) == 0) + { + if (0 == strcmp(">",exp_op) && !(predefs[x]->value > exp_version)) return argi; + if (0 == strcmp("<",exp_op) && !(predefs[x]->value < exp_version)) return argi; + if (0 == strcmp(">=",exp_op) && !(predefs[x]->value >= exp_version)) return argi; + if (0 == strcmp("<=",exp_op) && !(predefs[x]->value <= exp_version)) return argi; + if (0 == strcmp("==",exp_op) && !(predefs[x]->value == exp_version)) return argi; + if (0 == strcmp("!=",exp_op) && !(predefs[x]->value != exp_version)) return argi; + } + } + } + return 0; +} diff --git a/libs/predef/check/predef_check_as_cpp.cpp b/libs/predef/check/predef_check_as_cpp.cpp new file mode 100644 index 000000000..c58abe7a1 --- /dev/null +++ b/libs/predef/check/predef_check_as_cpp.cpp @@ -0,0 +1 @@ +#include "predef_check_as_c.c" diff --git a/libs/predef/check/predef_check_as_objc.m b/libs/predef/check/predef_check_as_objc.m new file mode 100644 index 000000000..c58abe7a1 --- /dev/null +++ b/libs/predef/check/predef_check_as_objc.m @@ -0,0 +1 @@ +#include "predef_check_as_c.c" diff --git a/libs/predef/check/predef_check_as_objcpp.mm b/libs/predef/check/predef_check_as_objcpp.mm new file mode 100644 index 000000000..c58abe7a1 --- /dev/null +++ b/libs/predef/check/predef_check_as_objcpp.mm @@ -0,0 +1 @@ +#include "predef_check_as_c.c" diff --git a/libs/predef/doc/history.qbk b/libs/predef/doc/history.qbk index b2fb81e12..5df5bf18d 100644 --- a/libs/predef/doc/history.qbk +++ b/libs/predef/doc/history.qbk @@ -1,5 +1,5 @@ [/ -Copyright 2014 Rene Rivera +Copyright 2014-2015 Rene Rivera 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) @@ -7,12 +7,22 @@ http://www.boost.org/LICENSE_1_0.txt) [section History] +[heading 1.2] + +* Account for skip in Visual Studio product version vs. compiler version. + This supports version of VS 2015 an onward. +* Add detection of Haiku OS (from Jessica Hamilton). +* Some fixes to endian detection for Android (from mstahl-at-redhat.com). +* Add missing `BOOST_PREDEF_MAKE_0X_VVRRPP` macro (from Erik Lindahl). +* Add `predef_check` program and BBv2 integration for build configuration + checks. + [heading 1.1] * Addition of `BOOST_PLAT_*` platform definitions for MinGW and Windows platform variants. * Detection of ARM architecture for Windows compilers to target - mobile devices of WIndows 8. + mobile devices of Windows 8. * Improved ARM detection for 64 bit ARM. * Added detection of iOS an an operating system. * Improved detection of endianess on some platforms. diff --git a/libs/predef/doc/html/index.html b/libs/predef/doc/html/index.html index 024453d80..8a4dde7e1 100644 --- a/libs/predef/doc/html/index.html +++ b/libs/predef/doc/html/index.html @@ -1,10 +1,10 @@ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> -<title>Predef 1.1</title> +<title>Predef 1.2</title> <link rel="stylesheet" href="boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="index.html" title="Predef 1.1"> +<link rel="home" href="index.html" title="Predef 1.2"> <link rel="next" href="predef/introduction.html" title="Introduction"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> @@ -13,7 +13,7 @@ <div class="titlepage"> <div> <div><h2 class="title"> -<a name="predef"></a>Predef 1.1</h2></div> +<a name="predef"></a>Predef 1.2</h2></div> <div><div class="authorgroup"><div class="author"><h3 class="author"> <span class="firstname">Rene</span> <span class="surname">Rivera</span> </h3></div></div></div> @@ -45,6 +45,7 @@ <dt><span class="section"><a href="predef/reference/version_definition_macros.html">Version definition macros</a></span></dt> </dl></dd> +<dt><span class="section"><a href="predef/check_utilities.html">Check Utilities</a></span></dt> <dt><span class="section"><a href="predef/history.html">History</a></span></dt> <dt><span class="section"><a href="predef/to_do.html">To Do</a></span></dt> <dt><span class="section"><a href="predef/acknoledgements.html">Acknoledgements</a></span></dt> @@ -52,7 +53,7 @@ </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: June 04, 2014 at 03:28:01 GMT</small></p></td> +<td align="left"><p><small>Last revised: January 29, 2015 at 21:39:36 GMT</small></p></td> <td align="right"><div class="copyright-footer"></div></td> </tr></table> <hr> diff --git a/libs/predef/doc/html/predef/acknoledgements.html b/libs/predef/doc/html/predef/acknoledgements.html index 7573714ac..9f73605b1 100644 --- a/libs/predef/doc/html/predef/acknoledgements.html +++ b/libs/predef/doc/html/predef/acknoledgements.html @@ -4,8 +4,8 @@ <title>Acknoledgements</title> <link rel="stylesheet" href="../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="../index.html" title="Predef 1.1"> -<link rel="up" href="../index.html" title="Predef 1.1"> +<link rel="home" href="../index.html" title="Predef 1.2"> +<link rel="up" href="../index.html" title="Predef 1.2"> <link rel="prev" href="to_do.html" title="To Do"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> diff --git a/libs/predef/doc/html/predef/adding_new_predefs.html b/libs/predef/doc/html/predef/adding_new_predefs.html index 091b7b7f3..37f49d454 100644 --- a/libs/predef/doc/html/predef/adding_new_predefs.html +++ b/libs/predef/doc/html/predef/adding_new_predefs.html @@ -4,8 +4,8 @@ <title>Adding new predefs</title> <link rel="stylesheet" href="../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="../index.html" title="Predef 1.1"> -<link rel="up" href="../index.html" title="Predef 1.1"> +<link rel="home" href="../index.html" title="Predef 1.2"> +<link rel="up" href="../index.html" title="Predef 1.2"> <link rel="prev" href="using_the_predefs.html" title="Using the predefs"> <link rel="next" href="reference.html" title="Reference"> </head> diff --git a/libs/predef/doc/html/predef/check_utilities.html b/libs/predef/doc/html/predef/check_utilities.html new file mode 100644 index 000000000..1664b197d --- /dev/null +++ b/libs/predef/doc/html/predef/check_utilities.html @@ -0,0 +1,148 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>Check Utilities</title> +<link rel="stylesheet" href="../boostbook.css" type="text/css"> +<meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> +<link rel="home" href="../index.html" title="Predef 1.2"> +<link rel="up" href="../index.html" title="Predef 1.2"> +<link rel="prev" href="reference/version_definition_macros.html" title="Version definition macros"> +<link rel="next" href="history.html" title="History"> +</head> +<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> +<div class="spirit-nav"> +<a accesskey="p" href="reference/version_definition_macros.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="history.html"><img src="../images/next.png" alt="Next"></a> +</div> +<div class="section"> +<div class="titlepage"><div><div><h2 class="title" style="clear: both"> +<a name="predef.check_utilities"></a><a class="link" href="check_utilities.html" title="Check Utilities">Check Utilities</a> +</h2></div></div></div> +<p> + The <code class="computeroutput"><span class="identifier">predef_check</span></code> utility provides + a facility for building a program that will check a given set of expressions + against the definitions it detected when it was built. + </p> +<h4> +<a name="predef.check_utilities.h0"></a> + <span class="phrase"><a name="predef.check_utilities.predef_check_programs"></a></span><a class="link" href="check_utilities.html#predef.check_utilities.predef_check_programs"><code class="literal">predef_check</code> + programs</a> + </h4> +<p> + Even though there is only one <code class="computeroutput"><span class="identifier">predef_check</span></code> + program, there are variations for each of the languages that are detected by + Predef to match the convention for sources files. For all of them one invokes + with a list of expression arguments. The expressions are evaluated within the + context of the particular <code class="literal">predef_check</code> program and if they + all are true zero (0) is returned. Otherwise the index of the first false expression + is returned. + </p> +<p> + The expression syntax is simple: + </p> +<pre class="programlisting">predef-definition [ relational-operator version-value ] +</pre> +<p> + <em class="replaceable"><code>predef-definition</code></em> can be any of the Predef definitions. + For example <code class="computeroutput"><span class="identifier">BOOST_COMP_GCC</span></code>. + </p> +<p> + <em class="replaceable"><code>relational-operator</code></em> can be any of: <code class="literal">></code>, + <code class="literal"><</code>, <code class="literal">>=</code>, <code class="literal"><=</code>, + <code class="literal">==</code> and <code class="literal">!=</code>. + </p> +<p> + <em class="replaceable"><code>version-number</code></em> can be a full or partial version + triplet value. If it's a partial version triple it is completed with zeros. + That is <code class="literal">x.y</code> is equivalent to <code class="literal">x.y.0</code> and + <code class="literal">x</code> is equivalent to <code class="literal">x.0.0</code>. + </p> +<p> + The <em class="replaceable"><code>relations-operator</code></em> and <em class="replaceable"><code>version-number</code></em> + can be ommited. In which case it is equivalent to: + </p> +<pre class="programlisting">predef-definition > 0.0.0 +</pre> +<h4> +<a name="predef.check_utilities.h1"></a> + <span class="phrase"><a name="predef.check_utilities.using_with_boost_build"></a></span><a class="link" href="check_utilities.html#predef.check_utilities.using_with_boost_build">Using + with Boost.Build</a> + </h4> +<p> + You can use the <code class="literal">predef_check</code> programs directly from Boost + Build to configure target requirements. This is useful for controlling what + gets built as part of your project based on the detailed version information + available in Predef. The basic use is simple: + </p> +<pre class="programlisting">import path-to-predef-src/check/predef + : check require + : predef-check predef-require ; + +exe my_windows_program : windows_source.cpp + : [ predef-require "BOOST_OS_WINDOWS" ] ; +</pre> +<p> + That simple use case will skip building the <code class="literal">my_windows_program</code> + unless one is building for Windows. Like the direct <code class="literal">predef_check</code> + you can pass mutiple expressions using relational comparisons. For example: + </p> +<pre class="programlisting">import path-to-predef-src/check/predef + : check require + : predef-check predef-require ; + +lib my_special_lib : source.cpp + : [ predef-require "BOOST_OS_WINDOWS != 0" "BOOST_OS_VMS != 0"] ; +</pre> +<p> + And in that case the <code class="literal">my_special_lib</code> is built only when the + OS is not Windows or VMS. The <code class="literal">requires</code> rule is a special + case of the <code class="literal">check</code> rule. And is defined in terms of it: + </p> +<pre class="programlisting">rule require ( expressions + : language ? ) +{ + return [ check $(expressions) : $(language) : : <build>no ] ; +} +</pre> +<p> + You can use the <code class="literal">check</code> rule for more control and to implement + something other than control of what gets built. The definition for the <code class="literal">check</code> + rule is: + </p> +<pre class="programlisting">rule check ( expressions + : language ? : true-properties * : false-properties * ) +</pre> +<p> + When invoked as a reuirement of a Boost Build target this rule will add the + <code class="literal">true-properties</code> to the target if all the <code class="literal">expressions</code> + evaluate to true. Otherwise the <code class="literal">false-properties</code> get added + as requirements. For example you could use it to enable or disable features + in your programs: + </p> +<pre class="programlisting">import path-to-predef-src/check/predef + : check require + : predef-check predef-require ; + +exe my_special_exe : source.cpp + : [ predef-check "BOOST_OS_WINDOWS == 0" + : <define>ENABLE_WMF=0 + : <define>ENABLE_WMF=1 ] ; +</pre> +<p> + For both <code class="literal">check</code> and <code class="literal">require</code> the <code class="literal">language</code> + argument controls which variant of the <code class="literal">predef_check</code> program + is used to check the expressions. It defaults to "c++", but can be + any of: "c", "cpp", "objc", and "objcpp". + </p> +</div> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> +<td align="left"></td> +<td align="right"><div class="copyright-footer">Copyright © 2005, 2008-2014 Rene Rivera<p> + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) + </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="reference/version_definition_macros.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="history.html"><img src="../images/next.png" alt="Next"></a> +</div> +</body> +</html> diff --git a/libs/predef/doc/html/predef/history.html b/libs/predef/doc/html/predef/history.html index 9d9a2efeb..883817d25 100644 --- a/libs/predef/doc/html/predef/history.html +++ b/libs/predef/doc/html/predef/history.html @@ -4,14 +4,14 @@ <title>History</title> <link rel="stylesheet" href="../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="../index.html" title="Predef 1.1"> -<link rel="up" href="../index.html" title="Predef 1.1"> -<link rel="prev" href="reference/version_definition_macros.html" title="Version definition macros"> +<link rel="home" href="../index.html" title="Predef 1.2"> +<link rel="up" href="../index.html" title="Predef 1.2"> +<link rel="prev" href="check_utilities.html" title="Check Utilities"> <link rel="next" href="to_do.html" title="To Do"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <div class="spirit-nav"> -<a accesskey="p" href="reference/version_definition_macros.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="to_do.html"><img src="../images/next.png" alt="Next"></a> +<a accesskey="p" href="check_utilities.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="to_do.html"><img src="../images/next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h2 class="title" style="clear: both"> @@ -19,6 +19,30 @@ </h2></div></div></div> <h4> <a name="predef.history.h0"></a> + <span class="phrase"><a name="predef.history.1_2"></a></span><a class="link" href="history.html#predef.history.1_2">1.2</a> + </h4> +<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> +<li class="listitem"> + Account for skip in Visual Studio product version vs. compiler version. + This supports version of VS 2015 an onward. + </li> +<li class="listitem"> + Add detection of Haiku OS (from Jessica Hamilton). + </li> +<li class="listitem"> + Some fixes to endian detection for Android (from mstahl-at-redhat.com). + </li> +<li class="listitem"> + Add missing <code class="computeroutput"><span class="identifier">BOOST_PREDEF_MAKE_0X_VVRRPP</span></code> + macro (from Erik Lindahl). + </li> +<li class="listitem"> + Add <code class="computeroutput"><span class="identifier">predef_check</span></code> program + and BBv2 integration for build configuration checks. + </li> +</ul></div> +<h4> +<a name="predef.history.h1"></a> <span class="phrase"><a name="predef.history.1_1"></a></span><a class="link" href="history.html#predef.history.1_1">1.1</a> </h4> <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> @@ -28,7 +52,7 @@ </li> <li class="listitem"> Detection of ARM architecture for Windows compilers to target mobile devices - of WIndows 8. + of Windows 8. </li> <li class="listitem"> Improved ARM detection for 64 bit ARM. @@ -68,7 +92,7 @@ </tr></table> <hr> <div class="spirit-nav"> -<a accesskey="p" href="reference/version_definition_macros.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="to_do.html"><img src="../images/next.png" alt="Next"></a> +<a accesskey="p" href="check_utilities.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="to_do.html"><img src="../images/next.png" alt="Next"></a> </div> </body> </html> diff --git a/libs/predef/doc/html/predef/introduction.html b/libs/predef/doc/html/predef/introduction.html index 66d39925f..ef085b03d 100644 --- a/libs/predef/doc/html/predef/introduction.html +++ b/libs/predef/doc/html/predef/introduction.html @@ -4,9 +4,9 @@ <title>Introduction</title> <link rel="stylesheet" href="../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="../index.html" title="Predef 1.1"> -<link rel="up" href="../index.html" title="Predef 1.1"> -<link rel="prev" href="../index.html" title="Predef 1.1"> +<link rel="home" href="../index.html" title="Predef 1.2"> +<link rel="up" href="../index.html" title="Predef 1.2"> +<link rel="prev" href="../index.html" title="Predef 1.2"> <link rel="next" href="using_the_predefs.html" title="Using the predefs"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> diff --git a/libs/predef/doc/html/predef/reference.html b/libs/predef/doc/html/predef/reference.html index c526fc518..9414b8f39 100644 --- a/libs/predef/doc/html/predef/reference.html +++ b/libs/predef/doc/html/predef/reference.html @@ -4,8 +4,8 @@ <title>Reference</title> <link rel="stylesheet" href="../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="../index.html" title="Predef 1.1"> -<link rel="up" href="../index.html" title="Predef 1.1"> +<link rel="home" href="../index.html" title="Predef 1.2"> +<link rel="up" href="../index.html" title="Predef 1.2"> <link rel="prev" href="adding_new_predefs.html" title="Adding new predefs"> <link rel="next" href="reference/boost_arch_architecture_macros.html" title="BOOST_ARCH architecture macros"> </head> diff --git a/libs/predef/doc/html/predef/reference/boost_arch_architecture_macros.html b/libs/predef/doc/html/predef/reference/boost_arch_architecture_macros.html index c790a496b..bd15acaec 100644 --- a/libs/predef/doc/html/predef/reference/boost_arch_architecture_macros.html +++ b/libs/predef/doc/html/predef/reference/boost_arch_architecture_macros.html @@ -4,7 +4,7 @@ <title>BOOST_ARCH architecture macros</title> <link rel="stylesheet" href="../../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="../../index.html" title="Predef 1.1"> +<link rel="home" href="../../index.html" title="Predef 1.2"> <link rel="up" href="../reference.html" title="Reference"> <link rel="prev" href="../reference.html" title="Reference"> <link rel="next" href="boost_comp_compiler_macros.html" title="BOOST_COMP compiler macros"> diff --git a/libs/predef/doc/html/predef/reference/boost_comp_compiler_macros.html b/libs/predef/doc/html/predef/reference/boost_comp_compiler_macros.html index ff590385f..3376fd0b9 100644 --- a/libs/predef/doc/html/predef/reference/boost_comp_compiler_macros.html +++ b/libs/predef/doc/html/predef/reference/boost_comp_compiler_macros.html @@ -4,7 +4,7 @@ <title>BOOST_COMP compiler macros</title> <link rel="stylesheet" href="../../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="../../index.html" title="Predef 1.1"> +<link rel="home" href="../../index.html" title="Predef 1.2"> <link rel="up" href="../reference.html" title="Reference"> <link rel="prev" href="boost_arch_architecture_macros.html" title="BOOST_ARCH architecture macros"> <link rel="next" href="boost_lang_language_standards_ma.html" title="BOOST_LANG language standards macros"> diff --git a/libs/predef/doc/html/predef/reference/boost_lang_language_standards_ma.html b/libs/predef/doc/html/predef/reference/boost_lang_language_standards_ma.html index de6940505..7623fc4f3 100644 --- a/libs/predef/doc/html/predef/reference/boost_lang_language_standards_ma.html +++ b/libs/predef/doc/html/predef/reference/boost_lang_language_standards_ma.html @@ -4,7 +4,7 @@ <title>BOOST_LANG language standards macros</title> <link rel="stylesheet" href="../../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="../../index.html" title="Predef 1.1"> +<link rel="home" href="../../index.html" title="Predef 1.2"> <link rel="up" href="../reference.html" title="Reference"> <link rel="prev" href="boost_comp_compiler_macros.html" title="BOOST_COMP compiler macros"> <link rel="next" href="boost_lib_library_macros.html" title="BOOST_LIB library macros"> diff --git a/libs/predef/doc/html/predef/reference/boost_lib_library_macros.html b/libs/predef/doc/html/predef/reference/boost_lib_library_macros.html index 7aecdd80d..6e9a5ffd8 100644 --- a/libs/predef/doc/html/predef/reference/boost_lib_library_macros.html +++ b/libs/predef/doc/html/predef/reference/boost_lib_library_macros.html @@ -4,7 +4,7 @@ <title>BOOST_LIB library macros</title> <link rel="stylesheet" href="../../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="../../index.html" title="Predef 1.1"> +<link rel="home" href="../../index.html" title="Predef 1.2"> <link rel="up" href="../reference.html" title="Reference"> <link rel="prev" href="boost_lang_language_standards_ma.html" title="BOOST_LANG language standards macros"> <link rel="next" href="boost_os_operating_system_macros.html" title="BOOST_OS operating system macros"> diff --git a/libs/predef/doc/html/predef/reference/boost_os_operating_system_macros.html b/libs/predef/doc/html/predef/reference/boost_os_operating_system_macros.html index efb940096..ca12588d5 100644 --- a/libs/predef/doc/html/predef/reference/boost_os_operating_system_macros.html +++ b/libs/predef/doc/html/predef/reference/boost_os_operating_system_macros.html @@ -4,7 +4,7 @@ <title>BOOST_OS operating system macros</title> <link rel="stylesheet" href="../../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="../../index.html" title="Predef 1.1"> +<link rel="home" href="../../index.html" title="Predef 1.2"> <link rel="up" href="../reference.html" title="Reference"> <link rel="prev" href="boost_lib_library_macros.html" title="BOOST_LIB library macros"> <link rel="next" href="boost_plat_platform_macros.html" title="BOOST_PLAT platform macros"> @@ -417,6 +417,44 @@ </table></div> <h5> <a name="predef.reference.boost_os_operating_system_macros.h6"></a> + <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_haiku"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_haiku"><code class="computeroutput"><span class="identifier">BOOST_OS_HAIKU</span></code></a> + </h5> +<p> + <a href="http://en.wikipedia.org/wiki/Haiku_(operating_system)" target="_top">Haiku</a> + operating system. + </p> +<div class="informaltable"><table class="table"> +<colgroup> +<col> +<col> +</colgroup> +<thead><tr> +<th> + <p> + Symbol + </p> + </th> +<th> + <p> + Version + </p> + </th> +</tr></thead> +<tbody><tr> +<td> + <p> + <code class="computeroutput"><span class="identifier">__HAIKU__</span></code> + </p> + </td> +<td> + <p> + <span class="bold"><strong>detection</strong></span> + </p> + </td> +</tr></tbody> +</table></div> +<h5> +<a name="predef.reference.boost_os_operating_system_macros.h7"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_hpux"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_hpux"><code class="computeroutput"><span class="identifier">BOOST_OS_HPUX</span></code></a> </h5> <p> @@ -479,7 +517,7 @@ </tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h7"></a> +<a name="predef.reference.boost_os_operating_system_macros.h8"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_ios"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_ios"><code class="computeroutput"><span class="identifier">BOOST_OS_IOS</span></code></a> </h5> <p> @@ -554,7 +592,7 @@ </tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h8"></a> +<a name="predef.reference.boost_os_operating_system_macros.h9"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_irix"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_irix"><code class="computeroutput"><span class="identifier">BOOST_OS_IRIX</span></code></a> </h5> <p> @@ -605,7 +643,7 @@ </tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h9"></a> +<a name="predef.reference.boost_os_operating_system_macros.h10"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_linux"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_linux"><code class="computeroutput"><span class="identifier">BOOST_OS_LINUX</span></code></a> </h5> <p> @@ -656,7 +694,7 @@ </tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h10"></a> +<a name="predef.reference.boost_os_operating_system_macros.h11"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_macos"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_macos"><code class="computeroutput"><span class="identifier">BOOST_OS_MACOS</span></code></a> </h5> <p> @@ -756,7 +794,7 @@ </tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h11"></a> +<a name="predef.reference.boost_os_operating_system_macros.h12"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_os400"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_os400"><code class="computeroutput"><span class="identifier">BOOST_OS_OS400</span></code></a> </h5> <p> @@ -794,7 +832,7 @@ </tr></tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h12"></a> +<a name="predef.reference.boost_os_operating_system_macros.h13"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_qnx"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_qnx"><code class="computeroutput"><span class="identifier">BOOST_OS_QNX</span></code></a> </h5> <p> @@ -871,7 +909,7 @@ </tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h13"></a> +<a name="predef.reference.boost_os_operating_system_macros.h14"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_solaris"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_solaris"><code class="computeroutput"><span class="identifier">BOOST_OS_SOLARIS</span></code></a> </h5> <p> @@ -923,7 +961,7 @@ </tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h14"></a> +<a name="predef.reference.boost_os_operating_system_macros.h15"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_unix"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_unix"><code class="computeroutput"><span class="identifier">BOOST_OS_UNIX</span></code></a> </h5> <p> @@ -999,7 +1037,7 @@ </tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h15"></a> +<a name="predef.reference.boost_os_operating_system_macros.h16"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_svr4"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_svr4"><code class="computeroutput"><span class="identifier">BOOST_OS_SVR4</span></code></a> </h5> <p> @@ -1075,7 +1113,7 @@ </tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h16"></a> +<a name="predef.reference.boost_os_operating_system_macros.h17"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_vms"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_vms"><code class="computeroutput"><span class="identifier">BOOST_OS_VMS</span></code></a> </h5> <p> @@ -1138,7 +1176,7 @@ </tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h17"></a> +<a name="predef.reference.boost_os_operating_system_macros.h18"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_windows"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_windows"><code class="computeroutput"><span class="identifier">BOOST_OS_WINDOWS</span></code></a> </h5> <p> @@ -1226,7 +1264,7 @@ </tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h18"></a> +<a name="predef.reference.boost_os_operating_system_macros.h19"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_bsd_bsdi"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_bsd_bsdi"><code class="computeroutput"><span class="identifier">BOOST_OS_BSD_BSDI</span></code></a> </h5> <p> @@ -1264,7 +1302,7 @@ </tr></tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h19"></a> +<a name="predef.reference.boost_os_operating_system_macros.h20"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_bsd_dragonfly"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_bsd_dragonfly"><code class="computeroutput"><span class="identifier">BOOST_OS_BSD_DRAGONFLY</span></code></a> </h5> <p> @@ -1302,7 +1340,7 @@ </tr></tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h20"></a> +<a name="predef.reference.boost_os_operating_system_macros.h21"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_bsd_free"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_bsd_free"><code class="computeroutput"><span class="identifier">BOOST_OS_BSD_FREE</span></code></a> </h5> <p> @@ -1354,7 +1392,7 @@ </tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h21"></a> +<a name="predef.reference.boost_os_operating_system_macros.h22"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_bsd_net"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_bsd_net"><code class="computeroutput"><span class="identifier">BOOST_OS_BSD_NET</span></code></a> </h5> <p> @@ -1466,7 +1504,7 @@ </tbody> </table></div> <h5> -<a name="predef.reference.boost_os_operating_system_macros.h22"></a> +<a name="predef.reference.boost_os_operating_system_macros.h23"></a> <span class="phrase"><a name="predef.reference.boost_os_operating_system_macros.boost_os_bsd_open"></a></span><a class="link" href="boost_os_operating_system_macros.html#predef.reference.boost_os_operating_system_macros.boost_os_bsd_open"><code class="computeroutput"><span class="identifier">BOOST_OS_BSD_OPEN</span></code></a> </h5> <p> diff --git a/libs/predef/doc/html/predef/reference/boost_plat_platform_macros.html b/libs/predef/doc/html/predef/reference/boost_plat_platform_macros.html index e554c77ef..9321e066e 100644 --- a/libs/predef/doc/html/predef/reference/boost_plat_platform_macros.html +++ b/libs/predef/doc/html/predef/reference/boost_plat_platform_macros.html @@ -4,7 +4,7 @@ <title>BOOST_PLAT platform macros</title> <link rel="stylesheet" href="../../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="../../index.html" title="Predef 1.1"> +<link rel="home" href="../../index.html" title="Predef 1.2"> <link rel="up" href="../reference.html" title="Reference"> <link rel="prev" href="boost_os_operating_system_macros.html" title="BOOST_OS operating system macros"> <link rel="next" href="other_macros.html" title="Other macros"> diff --git a/libs/predef/doc/html/predef/reference/other_macros.html b/libs/predef/doc/html/predef/reference/other_macros.html index b1e3f6fbf..802f689ed 100644 --- a/libs/predef/doc/html/predef/reference/other_macros.html +++ b/libs/predef/doc/html/predef/reference/other_macros.html @@ -4,7 +4,7 @@ <title>Other macros</title> <link rel="stylesheet" href="../../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="../../index.html" title="Predef 1.1"> +<link rel="home" href="../../index.html" title="Predef 1.2"> <link rel="up" href="../reference.html" title="Reference"> <link rel="prev" href="boost_plat_platform_macros.html" title="BOOST_PLAT platform macros"> <link rel="next" href="version_definition_macros.html" title="Version definition macros"> diff --git a/libs/predef/doc/html/predef/reference/version_definition_macros.html b/libs/predef/doc/html/predef/reference/version_definition_macros.html index c52ae4784..0451ca1d8 100644 --- a/libs/predef/doc/html/predef/reference/version_definition_macros.html +++ b/libs/predef/doc/html/predef/reference/version_definition_macros.html @@ -4,14 +4,14 @@ <title>Version definition macros</title> <link rel="stylesheet" href="../../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="../../index.html" title="Predef 1.1"> +<link rel="home" href="../../index.html" title="Predef 1.2"> <link rel="up" href="../reference.html" title="Reference"> <link rel="prev" href="other_macros.html" title="Other macros"> -<link rel="next" href="../history.html" title="History"> +<link rel="next" href="../check_utilities.html" title="Check Utilities"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <div class="spirit-nav"> -<a accesskey="p" href="other_macros.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.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="../history.html"><img src="../../images/next.png" alt="Next"></a> +<a accesskey="p" href="other_macros.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.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="../check_utilities.html"><img src="../../images/next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> @@ -106,6 +106,9 @@ <code class="computeroutput"><span class="identifier">BOOST_PREDEF_MAKE_0X_VRRPP000</span><span class="special">(</span><span class="identifier">V</span><span class="special">)</span></code> </p> <p> + <code class="computeroutput"><span class="identifier">BOOST_PREDEF_MAKE_0X_VVRRPP</span><span class="special">(</span><span class="identifier">V</span><span class="special">)</span></code> + </p> +<p> <code class="computeroutput"><span class="identifier">BOOST_PREDEF_MAKE_10_VPPP</span><span class="special">(</span><span class="identifier">V</span><span class="special">)</span></code> </p> <p> @@ -178,7 +181,7 @@ </tr></table> <hr> <div class="spirit-nav"> -<a accesskey="p" href="other_macros.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.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="../history.html"><img src="../../images/next.png" alt="Next"></a> +<a accesskey="p" href="other_macros.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.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="../check_utilities.html"><img src="../../images/next.png" alt="Next"></a> </div> </body> </html> diff --git a/libs/predef/doc/html/predef/to_do.html b/libs/predef/doc/html/predef/to_do.html index 200e3ce96..7c011016e 100644 --- a/libs/predef/doc/html/predef/to_do.html +++ b/libs/predef/doc/html/predef/to_do.html @@ -4,8 +4,8 @@ <title>To Do</title> <link rel="stylesheet" href="../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="../index.html" title="Predef 1.1"> -<link rel="up" href="../index.html" title="Predef 1.1"> +<link rel="home" href="../index.html" title="Predef 1.2"> +<link rel="up" href="../index.html" title="Predef 1.2"> <link rel="prev" href="history.html" title="History"> <link rel="next" href="acknoledgements.html" title="Acknoledgements"> </head> @@ -17,9 +17,14 @@ <div class="titlepage"><div><div><h2 class="title" style="clear: both"> <a name="predef.to_do"></a><a class="link" href="to_do.html" title="To Do">To Do</a> </h2></div></div></div> -<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> +<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> +<li class="listitem"> Improve reference documentation. - </li></ul></div> + </li> +<li class="listitem"> + Provide BOOST_WORKAROUND style macros for public use. + </li> +</ul></div> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> diff --git a/libs/predef/doc/html/predef/using_the_predefs.html b/libs/predef/doc/html/predef/using_the_predefs.html index 7ce9d04d6..c659ce6ea 100644 --- a/libs/predef/doc/html/predef/using_the_predefs.html +++ b/libs/predef/doc/html/predef/using_the_predefs.html @@ -4,8 +4,8 @@ <title>Using the predefs</title> <link rel="stylesheet" href="../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> -<link rel="home" href="../index.html" title="Predef 1.1"> -<link rel="up" href="../index.html" title="Predef 1.1"> +<link rel="home" href="../index.html" title="Predef 1.2"> +<link rel="up" href="../index.html" title="Predef 1.2"> <link rel="prev" href="introduction.html" title="Introduction"> <link rel="next" href="adding_new_predefs.html" title="Adding new predefs"> </head> diff --git a/libs/predef/doc/predef.qbk b/libs/predef/doc/predef.qbk index 75ec39d3f..07807cd2d 100644 --- a/libs/predef/doc/predef.qbk +++ b/libs/predef/doc/predef.qbk @@ -1,6 +1,6 @@ [article Predef [quickbook 1.7] - [version 1.1] + [version 1.2] [authors [Rivera, Rene]] [copyright 2005, 2008-2014 Rene Rivera] [purpose Identification and specification of predefined macros.] @@ -558,6 +558,133 @@ and "Y", "M", "D" for dates. [endsect] +[section Check Utilities] + +The `predef_check` utility provides a facility for building a +program that will check a given set of expressions against +the definitions it detected when it was built. + +[heading [^predef_check] programs] + +Even though there is only one `predef_check` program, there +are variations for each of the languages that are detected +by Predef to match the convention for sources files. For all +of them one invokes with a list of expression arguments. The +expressions are evaluated within the context of the particular +[^predef_check] program and if they all are true zero (0) is returned. +Otherwise the index of the first false expression is returned. + +The expression syntax is simple: + +[teletype] +`` +predef-definition [ relational-operator version-value ] +`` +[c++] + +[~predef-definition] can be any of the Predef definitions. For +example `BOOST_COMP_GCC`. + +[~relational-operator] can be any of: [^>], [^<], [^>=], [^<=], +[^==] and [^!=]. + +[~version-number] can be a full or partial version triplet value. +If it's a partial version triple it is completed with zeros. That +is [^x.y] is equivalent to [^x.y.0] and [^x] is equivalent to +[^x.0.0]. + +The [~relations-operator] and [~version-number] can be ommited. In +which case it is equivalent to: + +[teletype] +`` +predef-definition > 0.0.0 +`` +[c++] + +[heading Using with Boost.Build] + +You can use the [^predef_check] programs directly from Boost Build +to configure target requirements. This is useful for controlling +what gets built as part of your project based on the detailed +version information available in Predef. The basic use is simple: + +[teletype] +`` +import path-to-predef-src/check/predef + : check require + : predef-check predef-require ; + +exe my_windows_program : windows_source.cpp + : [ predef-require "BOOST_OS_WINDOWS" ] ; +`` +[c++] + +That simple use case will skip building the [^my_windows_program] +unless one is building for Windows. Like the direct [^predef_check] +you can pass mutiple expressions using relational comparisons. +For example: + +[teletype] +`` +import path-to-predef-src/check/predef + : check require + : predef-check predef-require ; + +lib my_special_lib : source.cpp + : [ predef-require "BOOST_OS_WINDOWS != 0" "BOOST_OS_VMS != 0"] ; +`` +[c++] + +And in that case the [^my_special_lib] is built only when the OS is +not Windows or VMS. The [^requires] rule is a special case of the +[^check] rule. And is defined in terms of it: + +[teletype] +`` +rule require ( expressions + : language ? ) +{ + return [ check $(expressions) : $(language) : : <build>no ] ; +} +`` +[c++] + +You can use the [^check] rule for more control and to implement +something other than control of what gets built. The definition +for the [^check] rule is: + +[teletype] +`` +rule check ( expressions + : language ? : true-properties * : false-properties * ) +`` +[c++] + +When invoked as a reuirement of a Boost Build target this rule +will add the [^true-properties] to the target if all the [^expressions] +evaluate to true. Otherwise the [^false-properties] get added as +requirements. For example you could use it to enable or disable +features in your programs: + +[teletype] +`` +import path-to-predef-src/check/predef + : check require + : predef-check predef-require ; + +exe my_special_exe : source.cpp + : [ predef-check "BOOST_OS_WINDOWS == 0" + : <define>ENABLE_WMF=0 + : <define>ENABLE_WMF=1 ] ; +`` +[c++] + +For both [^check] and [^require] the [^language] argument controls +which variant of the [^predef_check] program is used to check the +expressions. It defaults to "c++", but can be any of: "c", "cpp", +"objc", and "objcpp". + +[endsect] + [include history.qbk] [include todo.qbk] diff --git a/libs/predef/doc/todo.qbk b/libs/predef/doc/todo.qbk index 12f7db57f..aa1c845bc 100644 --- a/libs/predef/doc/todo.qbk +++ b/libs/predef/doc/todo.qbk @@ -8,5 +8,6 @@ http://www.boost.org/LICENSE_1_0.txt) [section To Do] * Improve reference documentation. +* Provide BOOST_WORKAROUND style macros for public use. [endsect] diff --git a/libs/predef/meta/libraries.json b/libs/predef/meta/libraries.json new file mode 100644 index 000000000..d7e326cdd --- /dev/null +++ b/libs/predef/meta/libraries.json @@ -0,0 +1,14 @@ +{ + "key": "predef", + "name": "Predef", + "authors": [ + "Rene Rivera" + ], + "description": "This library defines a set of compiler, architecture, operating system, library, and other version numbers from the information it can gather of C, C++, Objective C, and Objective C++ predefined macros or those defined in generally available headers.", + "category": [ + "Miscellaneous" + ], + "maintainers": [ + "Rene Rivera <grafikrobot -at- gmail.com>" + ] +} diff --git a/libs/predef/test/build.jam b/libs/predef/test/build.jam index 10ba4f8f8..28e147374 100755 --- a/libs/predef/test/build.jam +++ b/libs/predef/test/build.jam @@ -4,6 +4,8 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) +import ../check/predef : require : predef-require ; + local predef-include-root ; local predef-dependency ; @@ -53,6 +55,6 @@ test-suite predef : [ run info_as_objc.m : : : <test-info>always_show_run_output ] [ run version.cpp ] [ run make.cpp ] - [ compile macos_endian.c ] - [ compile macos_vs_bsd.c ] + [ compile macos_endian.c : [ predef-require "BOOST_OS_MACOS" : cpp ] ] + [ compile macos_vs_bsd.c : [ predef-require "BOOST_OS_MACOS" : cpp ] ] ; diff --git a/libs/predef/test/info_as_c.c b/libs/predef/test/info_as_c.c index fe26e84f9..ba84947f3 100644 --- a/libs/predef/test/info_as_c.c +++ b/libs/predef/test/info_as_c.c @@ -13,8 +13,8 @@ http://www.boost.org/LICENSE_1_0.txt) typedef struct predef_info { unsigned tag; - char * name; - char * description; + const char * name; + const char * description; unsigned value; } predef_info; @@ -46,7 +46,7 @@ int main() if (*i == 0x67890DEF) { predef_count += 1; - predefs = realloc(predefs,predef_count*sizeof(predef_info*)); + predefs = (predef_info**)realloc(predefs,predef_count*sizeof(predef_info*)); predefs[predef_count-1] = (predef_info*)i; } } diff --git a/libs/predef/test/make.cpp b/libs/predef/test/make.cpp index 9dbd4a8d4..3ae8192bc 100644 --- a/libs/predef/test/make.cpp +++ b/libs/predef/test/make.cpp @@ -36,6 +36,7 @@ void test_BOOST_VERSION_NUMBER() PREDEF_CHECK(BOOST_PREDEF_MAKE_0X_VRRPPPP(0xFFFFFFF) == BOOST_VERSION_NUMBER(0xF,0xFF,0xFFFF)); PREDEF_CHECK(BOOST_PREDEF_MAKE_0X_VVRRP(0xFFFFF) == BOOST_VERSION_NUMBER(0xFF,0xFF,0xF)); PREDEF_CHECK(BOOST_PREDEF_MAKE_0X_VRRPP000(0xFFFFF000) == BOOST_VERSION_NUMBER(0xF,0xFF,0xFF)); + PREDEF_CHECK(BOOST_PREDEF_MAKE_0X_VVRRPP(0xFFFFFF) == BOOST_VERSION_NUMBER(0xFF,0xFF,0xFF)); PREDEF_CHECK(BOOST_PREDEF_MAKE_10_VRP(999) == BOOST_VERSION_NUMBER(9,9,9)); PREDEF_CHECK(BOOST_PREDEF_MAKE_10_VPPP(9999) == BOOST_VERSION_NUMBER(9,0,999)); |