Merge branch 'feature/pragma-message' into develop

# Fixed Conflicts:
#	doc/html/index.html
This commit is contained in:
jzmaddock
2017-12-12 18:15:37 +00:00
9 changed files with 159 additions and 23 deletions

View File

@ -3969,7 +3969,7 @@
that is not otherwise described by one of the other Boost.Config that is not otherwise described by one of the other Boost.Config
macros. To use the macro you must first macros. To use the macro you must first
</p> </p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">detail</span><span class="special">/</span><span class="identifier">workaround</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">config</span><span class="special">/</span><span class="identifier">workaround</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre> </pre>
<p> <p>
usage is then: usage is then:
@ -4000,7 +4000,7 @@
</p> </p>
<p> <p>
<span class="bold"><strong>Note</strong></span>: the ultimate source of documentation <span class="bold"><strong>Note</strong></span>: the ultimate source of documentation
for this macro is in <a href="../../../../../boost/detail/workaround.hpp" target="_top">boost/detail/workaround.hpp</a>. for this macro is in <a href="../../../../../boost/config/workaround.hpp" target="_top">boost/config/workaround.hpp</a>.
</p> </p>
</td> </td>
</tr> </tr>
@ -4196,7 +4196,16 @@
<tr> <tr>
<td> <td>
<p> <p>
<code class="computeroutput"><span class="identifier">BOOST_EXPLICIT_TEMPLATE_TYPE</span><span class="special">(</span><span class="identifier">t</span><span class="special">)</span></code> <code class="computeroutput"><span class="identifier">BOOST_EXPLICIT_TEMPLATE_NON_TYPE</span><span class="special">(</span><span class="identifier">t</span><span class="special">,</span><span class="identifier">v</span><span class="special">)</span></code> <code class="computeroutput"><span class="identifier">BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE</span><span class="special">(</span><span class="identifier">t</span><span class="special">)</span></code> <code class="computeroutput"><span class="identifier">BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE</span><span class="special">(</span><span class="identifier">t</span><span class="special">,</span><span class="identifier">v</span><span class="special">)</span></code> <code class="computeroutput"><span class="identifier">BOOST_EXPLICIT_TEMPLATE_TYPE</span><span class="special">(</span><span class="identifier">t</span><span class="special">)</span></code>
</p>
<p>
<code class="computeroutput"><span class="identifier">BOOST_EXPLICIT_TEMPLATE_NON_TYPE</span><span class="special">(</span><span class="identifier">t</span><span class="special">,</span><span class="identifier">v</span><span class="special">)</span></code>
</p>
<p>
<code class="computeroutput"><span class="identifier">BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE</span><span class="special">(</span><span class="identifier">t</span><span class="special">)</span></code>
</p>
<p>
<code class="computeroutput"><span class="identifier">BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE</span><span class="special">(</span><span class="identifier">t</span><span class="special">,</span><span class="identifier">v</span><span class="special">)</span></code>
</p> </p>
</td> </td>
<td> <td>
@ -4465,6 +4474,8 @@
<td> <td>
<p> <p>
<code class="computeroutput"><span class="identifier">BOOST_LIKELY</span><span class="special">(</span><span class="identifier">X</span><span class="special">)</span></code> <code class="computeroutput"><span class="identifier">BOOST_LIKELY</span><span class="special">(</span><span class="identifier">X</span><span class="special">)</span></code>
</p>
<p>
<code class="computeroutput"><span class="identifier">BOOST_UNLIKELY</span><span class="special">(</span><span class="identifier">X</span><span class="special">)</span></code> <code class="computeroutput"><span class="identifier">BOOST_UNLIKELY</span><span class="special">(</span><span class="identifier">X</span><span class="special">)</span></code>
</p> </p>
</td> </td>
@ -4533,6 +4544,23 @@
</p> </p>
</td> </td>
</tr> </tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">BOOST_PRAGMA_MESSAGE</span><span class="special">(</span><span class="identifier">M</span><span class="special">)</span></code>
</p>
</td>
<td>
<p>
Defined in header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">config</span><span class="special">/</span><span class="identifier">pragma_message</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>,
this macro expands to the equivalent of <code class="computeroutput"><span class="preprocessor">#pragma</span>
<span class="identifier">message</span><span class="special">(</span><span class="identifier">M</span><span class="special">)</span></code>.
<code class="computeroutput"><span class="identifier">M</span></code> must be a string
literal. Example: <code class="computeroutput"><span class="identifier">BOOST_PRAGMA_MESSAGE</span><span class="special">(</span><span class="string">"This header
is deprecated."</span><span class="special">)</span></code>.
</p>
</td>
</tr>
</tbody> </tbody>
</table></div> </table></div>
</div> </div>

View File

@ -992,7 +992,7 @@
</div> </div>
</div> </div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: December 11, 2017 at 19:32:07 GMT</small></p></td> <td align="left"><p><small>Last revised: December 12, 2017 at 18:14:39 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td> <td align="right"><div class="copyright-footer"></div></td>
</tr></table> </tr></table>
<hr> <hr>

View File

@ -980,7 +980,7 @@ workarounds for compiler/standard library defects.
This macro is used where a compiler specific workaround is required that is not otherwise This macro is used where a compiler specific workaround is required that is not otherwise
described by one of the other Boost.Config macros. To use the macro you must first described by one of the other Boost.Config macros. To use the macro you must first
`` ``
#include <boost/detail/workaround.hpp> #include <boost/config/workaround.hpp>
`` ``
usage is then: usage is then:
`` ``
@ -1002,7 +1002,7 @@ For example
of `__BORLANDC__` /unless/ the macro `BOOST_DETECT_OUTDATED_WORKAROUNDS` is defined, in which case evaluates to of `__BORLANDC__` /unless/ the macro `BOOST_DETECT_OUTDATED_WORKAROUNDS` is defined, in which case evaluates to
`(__BORLANDC__ <= 0x590)`. `(__BORLANDC__ <= 0x590)`.
[*Note]: the ultimate source of documentation for this macro is in [@../../../../boost/detail/workaround.hpp boost/detail/workaround.hpp]. [*Note]: the ultimate source of documentation for this macro is in [@../../../../boost/config/workaround.hpp boost/config/workaround.hpp].
]] ]]
[[`BOOST_PREVENT_MACRO_SUBSTITUTION`][ [[`BOOST_PREVENT_MACRO_SUBSTITUTION`][
Sometimes you have a function name with the same name as a C macro, for example "min" and "max" Sometimes you have a function name with the same name as a C macro, for example "min" and "max"
@ -1096,8 +1096,11 @@ In either case this macro has no effect on runtime behavior and performance
of code. of code.
]] ]]
[[`BOOST_EXPLICIT_TEMPLATE_TYPE(t)` [[`BOOST_EXPLICIT_TEMPLATE_TYPE(t)`
`BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t,v)` `BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t,v)`
`BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t)` `BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t)`
`BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t,v)`][ `BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t,v)`][
Some compilers silently "fold" different function template instantiations if Some compilers silently "fold" different function template instantiations if
some of the template parameters don't appear in the function parameter list. some of the template parameters don't appear in the function parameter list.
@ -1248,6 +1251,7 @@ If the compiler does not support this markup, `BOOST_NORETURN` is defined empty
additional macro `BOOST_NO_NORETURN` is defined. additional macro `BOOST_NO_NORETURN` is defined.
]] ]]
[[`BOOST_LIKELY(X)` [[`BOOST_LIKELY(X)`
`BOOST_UNLIKELY(X)`][ `BOOST_UNLIKELY(X)`][
These macros communicate to the compiler that the conditional expression `X` is likely These macros communicate to the compiler that the conditional expression `X` is likely
or unlikely to yield a positive result. The expression should result in a boolean value. or unlikely to yield a positive result. The expression should result in a boolean value.
@ -1276,6 +1280,9 @@ Usage example:
typedef unsigned int BOOST_MAY_ALIAS aliasing_uint; typedef unsigned int BOOST_MAY_ALIAS aliasing_uint;
`` ``
]] ]]
[[`BOOST_PRAGMA_MESSAGE(M)`][Defined in header `<boost/config/pragma_message.hpp>`,
this macro expands to the equivalent of `#pragma message(M)`. `M` must be a string
literal. Example: `BOOST_PRAGMA_MESSAGE("This header is deprecated.")`.]]
] ]
[endsect] [endsect]

View File

@ -537,25 +537,10 @@ namespace std{ using ::type_info; }
// ---------------------------------------------------------------------------// // ---------------------------------------------------------------------------//
//
// Helper macro BOOST_STRINGIZE: // Helper macro BOOST_STRINGIZE:
// Converts the parameter X to a string after macro replacement
// on X has been performed.
//
#define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
#define BOOST_DO_STRINGIZE(X) #X
//
// Helper macro BOOST_JOIN: // Helper macro BOOST_JOIN:
// The following piece of macro magic joins the two
// arguments together, even when one of the arguments is #include <boost/config/helper_macros.hpp>
// itself a macro (see 16.3.1 in C++ standard). The key
// is that macro expansion of macro arguments does not
// occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN.
//
#define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y )
#define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y)
#define BOOST_DO_JOIN2( X, Y ) X##Y
// //
// Set some default values for compiler/library/platform names. // Set some default values for compiler/library/platform names.

View File

@ -0,0 +1,37 @@
#ifndef BOOST_CONFIG_HELPER_MACROS_HPP_INCLUDED
#define BOOST_CONFIG_HELPER_MACROS_HPP_INCLUDED
// Copyright 2001 John Maddock.
// Copyright 2017 Peter Dimov.
//
// 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
//
// BOOST_STRINGIZE(X)
// BOOST_JOIN(X, Y)
//
// Note that this header is C compatible.
//
// Helper macro BOOST_STRINGIZE:
// Converts the parameter X to a string after macro replacement
// on X has been performed.
//
#define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
#define BOOST_DO_STRINGIZE(X) #X
//
// Helper macro BOOST_JOIN:
// The following piece of macro magic joins the two
// arguments together, even when one of the arguments is
// itself a macro (see 16.3.1 in C++ standard). The key
// is that macro expansion of macro arguments does not
// occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN.
//
#define BOOST_JOIN(X, Y) BOOST_DO_JOIN(X, Y)
#define BOOST_DO_JOIN(X, Y) BOOST_DO_JOIN2(X,Y)
#define BOOST_DO_JOIN2(X, Y) X##Y
#endif // BOOST_CONFIG_HELPER_MACROS_HPP_INCLUDED

View File

@ -0,0 +1,29 @@
#ifndef BOOST_CONFIG_PRAGMA_MESSAGE_HPP_INCLUDED
#define BOOST_CONFIG_PRAGMA_MESSAGE_HPP_INCLUDED
// Copyright 2017 Peter Dimov.
//
// 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
//
// BOOST_PRAGMA_MESSAGE("message")
//
// Expands to the equivalent of #pragma message("message")
//
// Note that this header is C compatible.
#include <boost/config/helper_macros.hpp>
#if defined(BOOST_DISABLE_PRAGMA_MESSAGE)
# define BOOST_PRAGMA_MESSAGE(x)
#elif defined(__GNUC__)
# define BOOST_PRAGMA_MESSAGE(x) _Pragma(BOOST_STRINGIZE(message(x)))
#elif defined(_MSC_VER)
# define BOOST_PRAGMA_MESSAGE(x) __pragma(message(__FILE__ "(" BOOST_STRINGIZE(__LINE__) "): note: " x))
#else
# define BOOST_PRAGMA_MESSAGE(x)
#endif
#endif // BOOST_CONFIG_PRAGMA_MESSAGE_HPP_INCLUDED

View File

@ -103,6 +103,8 @@ test-suite config
[ run cstdint_test2.cpp : : : <warnings>all <toolset>gcc:<cxxflags>"-Wno-long-long -Wextra" <toolset>darwin:<cxxflags>-Wno-long-long ] [ run cstdint_test2.cpp : : : <warnings>all <toolset>gcc:<cxxflags>"-Wno-long-long -Wextra" <toolset>darwin:<cxxflags>-Wno-long-long ]
[ compile cstdint_include_test.cpp : <warnings>all <toolset>gcc:<cxxflags>-Wextra ] [ compile cstdint_include_test.cpp : <warnings>all <toolset>gcc:<cxxflags>-Wextra ]
[ run config_build_check.cpp : : : [ requires int128 cxx11_constexpr cxx11_user_defined_literals ] ] [ run config_build_check.cpp : : : [ requires int128 cxx11_constexpr cxx11_user_defined_literals ] ]
[ run helper_macros_test.cpp ]
[ compile pragma_message_test.cpp ]
; ;
obj has_clang_implicit_fallthrough : cmd_line_check.cpp : obj has_clang_implicit_fallthrough : cmd_line_check.cpp :

View File

@ -0,0 +1,30 @@
// Copyright 2017 Peter Dimov.
//
// 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 <boost/config/helper_macros.hpp>
#include <boost/core/lightweight_test.hpp>
int main()
{
#define X pumpkin
BOOST_TEST_CSTR_EQ( BOOST_STRINGIZE(X), "pumpkin" );
BOOST_TEST_CSTR_EQ( BOOST_STRINGIZE(__LINE__), "16" );
#define Y 2
int BOOST_JOIN(X, Y) = 0;
(void)pumpkin2;
int BOOST_JOIN(X, __LINE__) = 0;
(void)pumpkin23;
BOOST_TEST_CSTR_EQ( BOOST_STRINGIZE(BOOST_JOIN(X, Y)), "pumpkin2" );
BOOST_TEST_CSTR_EQ( BOOST_STRINGIZE(BOOST_JOIN(X, __LINE__)), "pumpkin27" );
return boost::report_errors();
}

View File

@ -0,0 +1,18 @@
// Copyright 2017 Peter Dimov.
//
// 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 <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("first message")
#define MSG2 "second message"
BOOST_PRAGMA_MESSAGE(MSG2)
#include <boost/config.hpp> // BOOST_STRINGIZE
#define MSG3 third message
BOOST_PRAGMA_MESSAGE(BOOST_STRINGIZE(MSG3))