update boost
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_IFBLOCK_HPP_D4676B36_00C5_41F4_BC9F_9CBBAE3B8006_INCLUDED)
|
||||
#define CPP_IFBLOCK_HPP_D4676B36_00C5_41F4_BC9F_9CBBAE3B8006_INCLUDED
|
||||
#if !defined(BOOST_CPP_IFBLOCK_HPP_D4676B36_00C5_41F4_BC9F_9CBBAE3B8006_INCLUDED)
|
||||
#define BOOST_CPP_IFBLOCK_HPP_D4676B36_00C5_41F4_BC9F_9CBBAE3B8006_INCLUDED
|
||||
|
||||
#include <stack>
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
void enter_if_block(bool new_status)
|
||||
{
|
||||
// If enclosing block is false, then this block is also false
|
||||
// If enclosing block is false, then this block is also false
|
||||
bool enclosing_status = get_status();
|
||||
this->push (value_type (new_status && enclosing_status, enclosing_status));
|
||||
}
|
||||
@@ -82,11 +82,11 @@ public:
|
||||
|
||||
if (get_enclosing_status()) {
|
||||
if (get_status()) {
|
||||
// entered a (false) #elif block from a true block
|
||||
// entered a (false) #elif block from a true block
|
||||
this->top().set_status(false);
|
||||
}
|
||||
else if (new_status && !this->top().get_some_part_status()) {
|
||||
// Entered true #elif block and no previous block was true
|
||||
// Entered true #elif block and no previous block was true
|
||||
this->top().set_status(new_status);
|
||||
}
|
||||
}
|
||||
@@ -99,15 +99,15 @@ public:
|
||||
|
||||
if (get_enclosing_status()) {
|
||||
if (!this->top().get_some_part_status()) {
|
||||
// Entered (true) #else block and no previous block was true
|
||||
// Entered (true) #else block and no previous block was true
|
||||
this->top().set_status(true);
|
||||
}
|
||||
else if (get_status()) {
|
||||
// Entered (false) #else block from true block
|
||||
// Entered (false) #else block from true block
|
||||
this->top().set_status(false);
|
||||
}
|
||||
|
||||
// Set else flag
|
||||
// Set else flag
|
||||
this->top().set_in_else();
|
||||
}
|
||||
return true;
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
// return, whether the top (innermost) condition is true or false
|
||||
// return, whether the top (innermost) condition is true or false
|
||||
bool get_status() const
|
||||
{
|
||||
return 0 == this->size() || this->top().get_status();
|
||||
@@ -158,4 +158,4 @@ protected:
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_IFBLOCK_HPP_D4676B36_00C5_41F4_BC9F_9CBBAE3B8006_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_IFBLOCK_HPP_D4676B36_00C5_41F4_BC9F_9CBBAE3B8006_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_INCLUDE_PATHS_HPP_AF620DA4_B3D2_4221_AD91_8A1ABFFB6944_INCLUDED)
|
||||
#define CPP_INCLUDE_PATHS_HPP_AF620DA4_B3D2_4221_AD91_8A1ABFFB6944_INCLUDED
|
||||
#if !defined(BOOST_CPP_INCLUDE_PATHS_HPP_AF620DA4_B3D2_4221_AD91_8A1ABFFB6944_INCLUDED)
|
||||
#define BOOST_CPP_INCLUDE_PATHS_HPP_AF620DA4_B3D2_4221_AD91_8A1ABFFB6944_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
@@ -273,11 +273,11 @@ bool include_paths::add_include_path (
|
||||
{
|
||||
namespace fs = boost::filesystem;
|
||||
if (path_) {
|
||||
fs::path newpath = util::complete_path(create_path(path_), current_dir);
|
||||
fs::path newpath = util::complete_path(create_path(path_), current_dir);
|
||||
|
||||
if (!fs::exists(newpath) || !fs::is_directory(newpath)) {
|
||||
// the given path does not form a name of a valid file system directory
|
||||
// item
|
||||
// the given path does not form a name of a valid file system directory
|
||||
// item
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -301,13 +301,13 @@ bool include_paths::find_include_file (std::string &s, std::string &dir,
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0
|
||||
if (0 != current_file) {
|
||||
// re-locate the directory of the current file (#include_next handling)
|
||||
// re-locate the directory of the current file (#include_next handling)
|
||||
|
||||
// #include_next does not distinguish between <file> and "file"
|
||||
// inclusion, nor does it check that the file you specify has the same
|
||||
// name as the current file. It simply looks for the file named, starting
|
||||
// with the directory in the search path after the one where the current
|
||||
// file was found.
|
||||
// #include_next does not distinguish between <file> and "file"
|
||||
// inclusion, nor does it check that the file you specify has the same
|
||||
// name as the current file. It simply looks for the file named, starting
|
||||
// with the directory in the search path after the one where the current
|
||||
// file was found.
|
||||
|
||||
fs::path file_path (create_path(current_file));
|
||||
for (/**/; it != include_paths_end; ++it) {
|
||||
@@ -352,20 +352,20 @@ include_paths::find_include_file (std::string &s, std::string &dir,
|
||||
{
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
// if not system include (<...>), then search current directory first
|
||||
// if not system include (<...>), then search current directory first
|
||||
if (!is_system) {
|
||||
if (!was_sys_include_path) { // set_sys_include_delimiter() not called
|
||||
// first have a look at the current directory
|
||||
fs::path currpath (create_path(s));
|
||||
if (!was_sys_include_path) { // set_sys_include_delimiter() not called
|
||||
// first have a look at the current directory
|
||||
fs::path currpath(create_path(s));
|
||||
if (!currpath.has_root_directory()) {
|
||||
currpath = create_path(current_dir.string());
|
||||
currpath /= create_path(s);
|
||||
}
|
||||
|
||||
if (fs::exists(currpath) && 0 == current_file) {
|
||||
// if 0 != current_path (#include_next handling) it can't be
|
||||
// the file in the current directory
|
||||
fs::path dirpath (create_path(s));
|
||||
// if 0 != current_path (#include_next handling) it can't be
|
||||
// the file in the current directory
|
||||
fs::path dirpath(create_path(s));
|
||||
if (!dirpath.has_root_directory()) {
|
||||
dirpath = create_path(current_rel_dir.string());
|
||||
dirpath /= create_path(s);
|
||||
@@ -376,23 +376,23 @@ include_paths::find_include_file (std::string &s, std::string &dir,
|
||||
return true;
|
||||
}
|
||||
|
||||
// iterate all user include file directories to find the file
|
||||
// iterate all user include file directories to find the file
|
||||
if (find_include_file(s, dir, user_include_paths, current_file))
|
||||
return true;
|
||||
|
||||
// ... fall through
|
||||
// ... fall through
|
||||
}
|
||||
else {
|
||||
// if set_sys_include_delimiter() was called, then user include files
|
||||
// are searched in the user search path only
|
||||
// if set_sys_include_delimiter() was called, then user include files
|
||||
// are searched in the user search path only
|
||||
return find_include_file(s, dir, user_include_paths, current_file);
|
||||
}
|
||||
|
||||
// if nothing found, fall through
|
||||
// ...
|
||||
// if nothing found, fall through
|
||||
// ...
|
||||
}
|
||||
|
||||
// iterate all system include file directories to find the file
|
||||
// iterate all system include file directories to find the file
|
||||
return find_include_file (s, dir, system_include_paths, current_file);
|
||||
}
|
||||
|
||||
@@ -545,4 +545,4 @@ BOOST_CLASS_VERSION(boost::wave::util::include_paths,
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_INCLUDE_PATHS_HPP_AF620DA4_B3D2_4221_AD91_8A1ABFFB6944_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_INCLUDE_PATHS_HPP_AF620DA4_B3D2_4221_AD91_8A1ABFFB6944_INCLUDED)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -10,11 +10,12 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_MACROMAP_PREDEF_HPP_HK041119)
|
||||
#define CPP_MACROMAP_PREDEF_HPP_HK041119
|
||||
#if !defined(BOOST_CPP_MACROMAP_PREDEF_HPP_HK041119)
|
||||
#define BOOST_CPP_MACROMAP_PREDEF_HPP_HK041119
|
||||
|
||||
#include <cstdio>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/format.hpp>
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/wave_config_constant.hpp>
|
||||
@@ -47,14 +48,14 @@ namespace util {
|
||||
typedef BOOST_WAVE_STRINGTYPE string_type;
|
||||
|
||||
public:
|
||||
// list of static predefined macros
|
||||
// list of static predefined macros
|
||||
struct static_macros {
|
||||
char const *name;
|
||||
boost::wave::token_id token_id;
|
||||
char const *value;
|
||||
};
|
||||
|
||||
// list of dynamic predefined macros
|
||||
// list of dynamic predefined macros
|
||||
struct dynamic_macros {
|
||||
char const *name;
|
||||
boost::wave::token_id token_id;
|
||||
@@ -68,27 +69,31 @@ namespace util {
|
||||
string_type version_; // __SPIRIT_PP_VERSION__/__WAVE_VERSION__
|
||||
string_type versionstr_; // __SPIRIT_PP_VERSION_STR__/__WAVE_VERSION_STR__
|
||||
|
||||
static string_type strconv(std::string const & ss)
|
||||
{
|
||||
return string_type(ss.c_str());
|
||||
}
|
||||
|
||||
protected:
|
||||
void reset_datestr()
|
||||
{
|
||||
static const char *const monthnames[] = {
|
||||
static const char *const monthnames[] = {
|
||||
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
||||
};
|
||||
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
using namespace std;
|
||||
|
||||
time_t tt = time(0);
|
||||
struct tm *tb = 0;
|
||||
time_t tt = time(0);
|
||||
struct tm *tb = 0;
|
||||
|
||||
if (tt != (time_t)-1) {
|
||||
char buffer[sizeof("\"Oct 11 1347\"")+1];
|
||||
|
||||
tb = localtime (&tt);
|
||||
sprintf (buffer, "\"%s %2d %4d\"",
|
||||
monthnames[tb->tm_mon], tb->tm_mday, tb->tm_year + 1900);
|
||||
datestr_ = buffer;
|
||||
datestr_ = strconv((boost::format("\"%s %2d %4d\"")
|
||||
% monthnames[tb->tm_mon]
|
||||
% tb->tm_mday
|
||||
% (tb->tm_year + 1900)).str());
|
||||
}
|
||||
else {
|
||||
datestr_ = "\"??? ?? ????\"";
|
||||
@@ -97,19 +102,18 @@ namespace util {
|
||||
|
||||
void reset_timestr()
|
||||
{
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
using namespace std;
|
||||
|
||||
time_t tt = time(0);
|
||||
struct tm *tb = 0;
|
||||
time_t tt = time(0);
|
||||
struct tm *tb = 0;
|
||||
|
||||
if (tt != (time_t)-1) {
|
||||
char buffer[sizeof("\"12:34:56\"")+1];
|
||||
|
||||
tb = localtime (&tt);
|
||||
sprintf (buffer, "\"%02d:%02d:%02d\"", tb->tm_hour,
|
||||
tb->tm_min, tb->tm_sec);
|
||||
timestr_ = buffer;
|
||||
timestr_ = strconv((boost::format("\"%02d:%02d:%02d\"")
|
||||
% tb->tm_hour
|
||||
% tb->tm_min
|
||||
% tb->tm_sec).str());
|
||||
}
|
||||
else {
|
||||
timestr_ = "\"??:??:??\"";
|
||||
@@ -118,14 +122,12 @@ namespace util {
|
||||
|
||||
void reset_version()
|
||||
{
|
||||
char buffer[sizeof("0x00000000")+1];
|
||||
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
using namespace std;
|
||||
|
||||
// calculate the number of days since Dec 13 2001
|
||||
// (the day the Wave project was started)
|
||||
tm first_day;
|
||||
// calculate the number of days since Dec 13 2001
|
||||
// (the day the Wave project was started)
|
||||
tm first_day;
|
||||
|
||||
using namespace std; // for some systems memset is in namespace std
|
||||
memset (&first_day, 0, sizeof(tm));
|
||||
@@ -133,61 +135,57 @@ namespace util {
|
||||
first_day.tm_mday = 13; // 13
|
||||
first_day.tm_year = 101; // 2001
|
||||
|
||||
long seconds = long(difftime(compilation_time_.get_time(), mktime(&first_day)));
|
||||
long seconds = long(difftime(compilation_time_.get_time(), mktime(&first_day)));
|
||||
|
||||
sprintf(buffer, "0x%02d%1d%1d%04ld", BOOST_WAVE_VERSION_MAJOR,
|
||||
BOOST_WAVE_VERSION_MINOR, BOOST_WAVE_VERSION_SUBMINOR,
|
||||
seconds/(3600*24));
|
||||
version_ = buffer;
|
||||
version_ = strconv((boost::format("0x%02d%1d%1d%04ld")
|
||||
% BOOST_WAVE_VERSION_MAJOR
|
||||
% BOOST_WAVE_VERSION_MINOR
|
||||
% BOOST_WAVE_VERSION_SUBMINOR
|
||||
% (seconds/(3600*24))).str());
|
||||
}
|
||||
|
||||
void reset_versionstr()
|
||||
{
|
||||
char buffer[sizeof("\"00.00.00.0000 \"")+sizeof(BOOST_PLATFORM)+sizeof(BOOST_COMPILER)+4];
|
||||
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
using namespace std;
|
||||
|
||||
// calculate the number of days since Dec 13 2001
|
||||
// (the day the Wave project was started)
|
||||
tm first_day;
|
||||
// calculate the number of days since Dec 13 2001
|
||||
// (the day the Wave project was started)
|
||||
tm first_day;
|
||||
|
||||
memset (&first_day, 0, sizeof(tm));
|
||||
first_day.tm_mon = 11; // Dec
|
||||
first_day.tm_mday = 13; // 13
|
||||
first_day.tm_year = 101; // 2001
|
||||
|
||||
long seconds = long(difftime(compilation_time_.get_time(), mktime(&first_day)));
|
||||
long seconds = long(difftime(compilation_time_.get_time(), mktime(&first_day)));
|
||||
|
||||
sprintf(buffer, "\"%d.%d.%d.%ld [%s/%s]\"", BOOST_WAVE_VERSION_MAJOR,
|
||||
BOOST_WAVE_VERSION_MINOR, BOOST_WAVE_VERSION_SUBMINOR,
|
||||
seconds/(3600*24), BOOST_PLATFORM, BOOST_COMPILER);
|
||||
versionstr_ = buffer;
|
||||
versionstr_ = strconv((boost::format("\"%d.%d.%d.%ld [%s/%s]\"")
|
||||
% BOOST_WAVE_VERSION_MAJOR
|
||||
% BOOST_WAVE_VERSION_MINOR
|
||||
% BOOST_WAVE_VERSION_SUBMINOR
|
||||
% (seconds/(3600*24))
|
||||
% BOOST_PLATFORM
|
||||
% BOOST_COMPILER).str());
|
||||
}
|
||||
|
||||
// dynamic predefined macros
|
||||
// dynamic predefined macros
|
||||
string_type get_date() const { return datestr_; } // __DATE__
|
||||
string_type get_time() const { return timestr_; } // __TIME__
|
||||
|
||||
// __SPIRIT_PP__/__WAVE__
|
||||
// __SPIRIT_PP__/__WAVE__
|
||||
string_type get_version() const
|
||||
{
|
||||
char buffer[sizeof("0x0000")+1];
|
||||
|
||||
using namespace std; // for some systems sprintf is in namespace std
|
||||
sprintf(buffer, "0x%02d%1d%1d", BOOST_WAVE_VERSION_MAJOR,
|
||||
BOOST_WAVE_VERSION_MINOR, BOOST_WAVE_VERSION_SUBMINOR);
|
||||
return buffer;
|
||||
return strconv((boost::format("0x%02d%1d%1d")
|
||||
% BOOST_WAVE_VERSION_MAJOR
|
||||
% BOOST_WAVE_VERSION_MINOR
|
||||
% BOOST_WAVE_VERSION_SUBMINOR).str());
|
||||
}
|
||||
|
||||
// __WAVE_CONFIG__
|
||||
// __WAVE_CONFIG__
|
||||
string_type get_config() const
|
||||
{
|
||||
char buffer[sizeof("0x00000000")+1];
|
||||
|
||||
using namespace std; // for some systems sprintf is in namespace std
|
||||
sprintf(buffer, "0x%08x", BOOST_WAVE_CONFIG);
|
||||
return buffer;
|
||||
return strconv((boost::format("0x%08x") % BOOST_WAVE_CONFIG).str());
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -205,13 +203,13 @@ namespace util {
|
||||
reset_timestr();
|
||||
}
|
||||
|
||||
// __SPIRIT_PP_VERSION__/__WAVE_VERSION__
|
||||
// __SPIRIT_PP_VERSION__/__WAVE_VERSION__
|
||||
string_type get_fullversion() const { return version_; }
|
||||
|
||||
// __SPIRIT_PP_VERSION_STR__/__WAVE_VERSION_STR__
|
||||
// __SPIRIT_PP_VERSION_STR__/__WAVE_VERSION_STR__
|
||||
string_type get_versionstr() const { return versionstr_; }
|
||||
|
||||
// C++ mode
|
||||
// C++ mode
|
||||
static_macros const& static_data_cpp(std::size_t i) const
|
||||
{
|
||||
static static_macros data[] = {
|
||||
@@ -224,7 +222,7 @@ namespace util {
|
||||
}
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_CPP0X != 0
|
||||
// C++11 mode
|
||||
// C++11 mode
|
||||
static_macros const& static_data_cpp0x(std::size_t i) const
|
||||
{
|
||||
static static_macros data[] = {
|
||||
@@ -240,8 +238,25 @@ namespace util {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_CPP2A != 0
|
||||
// C++20 mode
|
||||
static_macros const& static_data_cpp2a(std::size_t i) const
|
||||
{
|
||||
static static_macros data[] = {
|
||||
{ "__STDC__", T_INTLIT, "1" },
|
||||
{ "__cplusplus", T_INTLIT, "202002L" },
|
||||
{ "__STDC_VERSION__", T_INTLIT, "199901L" },
|
||||
{ "__STDC_HOSTED__", T_INTLIT, "0" },
|
||||
{ "__WAVE_HAS_VARIADICS__", T_INTLIT, "1" },
|
||||
{ 0, T_EOF, 0 }
|
||||
};
|
||||
BOOST_ASSERT(i < sizeof(data)/sizeof(data[0]));
|
||||
return data[i];
|
||||
}
|
||||
#endif
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
|
||||
// C99 mode
|
||||
// C99 mode
|
||||
static_macros const& static_data_c99(std::size_t i) const
|
||||
{
|
||||
static static_macros data[] = {
|
||||
@@ -285,4 +300,4 @@ namespace util {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_MACROMAP_PREDEF_HPP_HK041119)
|
||||
#endif // !defined(BOOST_CPP_MACROMAP_PREDEF_HPP_HK041119)
|
||||
|
||||
@@ -10,14 +10,15 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_MACROMAP_UTIL_HPP_HK041119)
|
||||
#define CPP_MACROMAP_UTIL_HPP_HK041119
|
||||
#if !defined(BOOST_CPP_MACROMAP_UTIL_HPP_HK041119)
|
||||
#define BOOST_CPP_MACROMAP_UTIL_HPP_HK041119
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/token_ids.hpp>
|
||||
#include <boost/wave/util/unput_queue_iterator.hpp>
|
||||
#include <boost/wave/language_support.hpp>
|
||||
|
||||
// this must occur after all of the includes and before any code appears
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
@@ -135,9 +136,9 @@ namespace impl {
|
||||
// Test, whether a given identifier resolves to a predefined name
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
template <typename StringT>
|
||||
template <typename ContextT, typename StringT>
|
||||
inline bool
|
||||
is_special_macroname (StringT const &name)
|
||||
is_special_macroname (ContextT const & ctx, StringT const &name)
|
||||
{
|
||||
if (name.size() < 7)
|
||||
return false;
|
||||
@@ -145,8 +146,14 @@ is_special_macroname (StringT const &name)
|
||||
if ("defined" == name)
|
||||
return true;
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_HAS_INCLUDE != 0
|
||||
if (boost::wave::need_has_include(ctx.get_language()) &&
|
||||
("__has_include" == name))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
if ('_' == name[0] && '_' == name[1]) {
|
||||
StringT str = name.substr(2);
|
||||
StringT str = name.substr(2);
|
||||
|
||||
if (str == "cplusplus" || str == "STDC__" ||
|
||||
str == "TIME__" || str == "DATE__" ||
|
||||
@@ -172,9 +179,9 @@ token_equals(TokenT const &left, TokenT const &right)
|
||||
using namespace boost::wave;
|
||||
|
||||
if (IS_CATEGORY(left, ParameterTokenType)) {
|
||||
// if the existing token is of type T_PARAMETERBASE, then the right token
|
||||
// must be of type T_IDENTIFIER or a keyword
|
||||
token_id id = token_id(right);
|
||||
// if the existing token is of type T_PARAMETERBASE, then the right token
|
||||
// must be of type T_IDENTIFIER or a keyword
|
||||
token_id id = token_id(right);
|
||||
|
||||
return (T_IDENTIFIER == id ||
|
||||
IS_CATEGORY(id, KeywordTokenType) ||
|
||||
@@ -202,22 +209,22 @@ definition_equals(ContainerT const &definition,
|
||||
{
|
||||
typedef typename ContainerT::const_iterator const_iterator_type;
|
||||
|
||||
const_iterator_type first1 = definition.begin();
|
||||
const_iterator_type last1 = definition.end();
|
||||
const_iterator_type first2 = new_definition.begin();
|
||||
const_iterator_type last2 = new_definition.end();
|
||||
const_iterator_type first1 = definition.begin();
|
||||
const_iterator_type last1 = definition.end();
|
||||
const_iterator_type first2 = new_definition.begin();
|
||||
const_iterator_type last2 = new_definition.end();
|
||||
|
||||
while (first1 != last1 && first2 != last2 && token_equals(*first1, *first2))
|
||||
{
|
||||
// skip whitespace, if both sequences have a whitespace next
|
||||
token_id id1 = next_token<const_iterator_type>::peek(first1, last1, false);
|
||||
token_id id2 = next_token<const_iterator_type>::peek(first2, last2, false);
|
||||
// skip whitespace, if both sequences have a whitespace next
|
||||
token_id id1 = next_token<const_iterator_type>::peek(first1, last1, false);
|
||||
token_id id2 = next_token<const_iterator_type>::peek(first2, last2, false);
|
||||
|
||||
if (IS_CATEGORY(id1, WhiteSpaceTokenType) &&
|
||||
IS_CATEGORY(id2, WhiteSpaceTokenType))
|
||||
{
|
||||
// all consecutive whitespace tokens count as one whitespace
|
||||
// adjust first1 and first2 accordingly
|
||||
// all consecutive whitespace tokens count as one whitespace
|
||||
// adjust first1 and first2 accordingly
|
||||
skip_whitespace(first1, last1);
|
||||
skip_whitespace(first2, last2);
|
||||
}
|
||||
@@ -228,7 +235,7 @@ const_iterator_type last2 = new_definition.end();
|
||||
++first2;
|
||||
}
|
||||
else {
|
||||
// the sequences differ
|
||||
// the sequences differ
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -249,13 +256,13 @@ parameters_equal(ContainerT const ¶meters, ContainerT const &new_parameters)
|
||||
|
||||
typedef typename ContainerT::const_iterator const_iterator_type;
|
||||
|
||||
const_iterator_type first1 = parameters.begin();
|
||||
const_iterator_type last1 = parameters.end();
|
||||
const_iterator_type first2 = new_parameters.begin();
|
||||
const_iterator_type last2 = new_parameters.end();
|
||||
const_iterator_type first1 = parameters.begin();
|
||||
const_iterator_type last1 = parameters.end();
|
||||
const_iterator_type first2 = new_parameters.begin();
|
||||
const_iterator_type last2 = new_parameters.end();
|
||||
|
||||
while (first1 != last1 && first2 != last2) {
|
||||
// parameters are different, if the corresponding tokens are different
|
||||
// parameters are different, if the corresponding tokens are different
|
||||
using namespace boost::wave;
|
||||
if (token_id(*first1) != token_id(*first2) ||
|
||||
(*first1).get_value() != (*first2).get_value())
|
||||
@@ -279,10 +286,10 @@ trim_replacement_list (ContainerT &replacement_list)
|
||||
{
|
||||
using namespace boost::wave;
|
||||
|
||||
// strip leading whitespace
|
||||
// strip leading whitespace
|
||||
if (replacement_list.size() > 0) {
|
||||
typename ContainerT::iterator end = replacement_list.end();
|
||||
typename ContainerT::iterator it = replacement_list.begin();
|
||||
typename ContainerT::iterator end = replacement_list.end();
|
||||
typename ContainerT::iterator it = replacement_list.begin();
|
||||
|
||||
while (it != end && IS_CATEGORY(*it, WhiteSpaceTokenType)) {
|
||||
token_id id(*it);
|
||||
@@ -298,16 +305,16 @@ trim_replacement_list (ContainerT &replacement_list)
|
||||
}
|
||||
}
|
||||
|
||||
// strip trailing whitespace
|
||||
// strip trailing whitespace
|
||||
if (replacement_list.size() > 0) {
|
||||
typename ContainerT::reverse_iterator rend = replacement_list.rend();
|
||||
typename ContainerT::reverse_iterator rit = replacement_list.rbegin();
|
||||
typename ContainerT::reverse_iterator rend = replacement_list.rend();
|
||||
typename ContainerT::reverse_iterator rit = replacement_list.rbegin();
|
||||
|
||||
while (rit != rend && IS_CATEGORY(*rit, WhiteSpaceTokenType))
|
||||
++rit;
|
||||
|
||||
typename ContainerT::iterator end = replacement_list.end();
|
||||
typename ContainerT::iterator it = rit.base();
|
||||
typename ContainerT::iterator end = replacement_list.end();
|
||||
typename ContainerT::iterator it = rit.base();
|
||||
|
||||
while (it != end && IS_CATEGORY(*it, WhiteSpaceTokenType)) {
|
||||
token_id id(*it);
|
||||
@@ -343,6 +350,27 @@ is_whitespace_only (ContainerT const &argument)
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Tests whether the given token sequence consists only of whitespace
|
||||
// and placemarkers
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
template <typename ContainerT>
|
||||
inline bool
|
||||
is_blank_only (ContainerT const &argument)
|
||||
{
|
||||
typename ContainerT::const_iterator end = argument.end();
|
||||
for (typename ContainerT::const_iterator it = argument.begin();
|
||||
it != end; ++it)
|
||||
{
|
||||
if (!IS_CATEGORY(*it, WhiteSpaceTokenType) &&
|
||||
(T_PLACEMARKER != token_id(*it)))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Remove all placeholder tokens from the given token sequence
|
||||
@@ -354,10 +382,10 @@ remove_placeholders (ContainerT &replacement_list)
|
||||
{
|
||||
using namespace boost::wave;
|
||||
|
||||
// strip leading whitespace
|
||||
// strip leading whitespace
|
||||
if (replacement_list.size() > 0) {
|
||||
typename ContainerT::iterator end = replacement_list.end();
|
||||
typename ContainerT::iterator it = replacement_list.begin();
|
||||
typename ContainerT::iterator end = replacement_list.end();
|
||||
typename ContainerT::iterator it = replacement_list.begin();
|
||||
|
||||
while (it != end) {
|
||||
token_id id(*it);
|
||||
@@ -372,7 +400,7 @@ remove_placeholders (ContainerT &replacement_list)
|
||||
}
|
||||
}
|
||||
|
||||
// remove all 'new' leading and trailing whitespace
|
||||
// remove all 'new' leading and trailing whitespace
|
||||
if (is_whitespace_only(replacement_list))
|
||||
trim_replacement_list(replacement_list);
|
||||
}
|
||||
@@ -389,7 +417,7 @@ trim_sequence_left (ContainerT &argument)
|
||||
{
|
||||
using namespace boost::wave;
|
||||
|
||||
// strip leading whitespace (should be only one token)
|
||||
// strip leading whitespace (should be only one token)
|
||||
if (argument.size() > 0 &&
|
||||
IS_CATEGORY(argument.front(), WhiteSpaceTokenType))
|
||||
{
|
||||
@@ -408,7 +436,7 @@ trim_sequence_right (ContainerT &argument)
|
||||
{
|
||||
using namespace boost::wave;
|
||||
|
||||
// strip trailing whitespace (should be only one token)
|
||||
// strip trailing whitespace (should be only one token)
|
||||
if (argument.size() > 0 &&
|
||||
IS_CATEGORY(argument.back(), WhiteSpaceTokenType))
|
||||
{
|
||||
@@ -436,11 +464,7 @@ template <typename ContextT>
|
||||
void call_skipped_token_hook(ContextT& ctx,
|
||||
typename ContextT::token_type const& skipped)
|
||||
{
|
||||
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
|
||||
ctx.get_hooks().skipped_token(skipped);
|
||||
#else
|
||||
ctx.get_hooks().skipped_token(ctx.derived(), skipped);
|
||||
#endif
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -572,4 +596,4 @@ to_string(Src const& src)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_MACROMAP_UTIL_HPP_HK041119)
|
||||
#endif // !defined(BOOST_CPP_MACROMAP_UTIL_HPP_HK041119)
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(FILE_POSITION_H_52BDEDF7_DAD3_4F24_802F_E66BB8098F68_INCLUDED)
|
||||
#define FILE_POSITION_H_52BDEDF7_DAD3_4F24_802F_E66BB8098F68_INCLUDED
|
||||
#if !defined(BOOST_FILE_POSITION_H_52BDEDF7_DAD3_4F24_802F_E66BB8098F68_INCLUDED)
|
||||
#define BOOST_FILE_POSITION_H_52BDEDF7_DAD3_4F24_802F_E66BB8098F68_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include <ostream>
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
: file(file_), line(line_), column(column_)
|
||||
{}
|
||||
|
||||
// accessors
|
||||
// accessors
|
||||
string_type const &get_file() const { return file; }
|
||||
std::size_t get_line() const { return line; }
|
||||
std::size_t get_column() const { return column; }
|
||||
@@ -192,4 +192,4 @@ namespace spirit { namespace classic {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(FILE_POSITION_H_52BDEDF7_DAD3_4F24_802F_E66BB8098F68_INCLUDED)
|
||||
#endif // !defined(BOOST_FILE_POSITION_H_52BDEDF7_DAD3_4F24_802F_E66BB8098F68_INCLUDED)
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
// - Removed the getline implementation which was borrowed from the SGI
|
||||
// STL as the license for this code is not compatible with Boost.
|
||||
|
||||
#ifndef FLEX_STRING_INC_
|
||||
#define FLEX_STRING_INC_
|
||||
#ifndef BOOST_FLEX_STRING_INC_
|
||||
#define BOOST_FLEX_STRING_INC_
|
||||
|
||||
/*
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -87,6 +87,7 @@ class StoragePolicy
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
|
||||
#include <boost/core/allocator_access.hpp>
|
||||
#include <boost/iterator/reverse_iterator.hpp>
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
@@ -100,7 +101,6 @@ class StoragePolicy
|
||||
|
||||
#include <memory>
|
||||
#include <new>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
@@ -287,29 +287,15 @@ inline bool operator!=(const mallocator<T>&,
|
||||
return false;
|
||||
}
|
||||
|
||||
template <class Allocator>
|
||||
typename Allocator::pointer Reallocate(
|
||||
Allocator& alloc,
|
||||
typename Allocator::pointer p,
|
||||
typename Allocator::size_type oldObjCount,
|
||||
typename Allocator::size_type newObjCount,
|
||||
void*)
|
||||
{
|
||||
// @@@ not implemented
|
||||
return NULL;
|
||||
}
|
||||
|
||||
template <class Allocator>
|
||||
typename Allocator::pointer Reallocate(
|
||||
Allocator& alloc,
|
||||
typename Allocator::pointer p,
|
||||
typename Allocator::size_type oldObjCount,
|
||||
typename Allocator::size_type newObjCount,
|
||||
mallocator<void>*)
|
||||
{
|
||||
// @@@ not implemented
|
||||
return NULL;
|
||||
}
|
||||
#if defined(BOOST_GCC) && BOOST_GCC >= 40700
|
||||
// gcc 11.2 fails to deduce below that pData_ never points to emptyString_ if capacity() == 0 and emits warnings like these:
|
||||
// 'operator delete(void*, unsigned long)' called on unallocated object 'boost::wave::util::SimpleStringStorage<char, std::allocator<char> >::emptyString_' [-Wfree-nonheap-object]
|
||||
// Unfortunately, suppressing this warning doesn't work, so we have to use __builtin_unreachable() to assert that this never happens.
|
||||
// __builtin_unreachable is supported since gcc 4.6, -Wfree-nonheap-object is supported since 4.7.
|
||||
#define BOOST_WAVE_COMPILE_TIME_ASSERT(x) if (!(x)) __builtin_unreachable()
|
||||
#else
|
||||
#define BOOST_WAVE_COMPILE_TIME_ASSERT(x)
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// class template SimpleStringStorage
|
||||
@@ -331,7 +317,7 @@ public:
|
||||
};
|
||||
static const Data emptyString_;
|
||||
|
||||
typedef typename A::size_type size_type;
|
||||
typedef typename boost::allocator_size_type<A>::type size_type;
|
||||
|
||||
private:
|
||||
Data* pData_;
|
||||
@@ -408,7 +394,11 @@ public:
|
||||
~SimpleStringStorage()
|
||||
{
|
||||
BOOST_ASSERT(begin() <= end());
|
||||
if (pData_ != &emptyString_) free(pData_);
|
||||
if (capacity() > 0)
|
||||
{
|
||||
BOOST_WAVE_COMPILE_TIME_ASSERT(pData_ != &emptyString_);
|
||||
free(pData_);
|
||||
}
|
||||
}
|
||||
|
||||
iterator begin()
|
||||
@@ -434,13 +424,14 @@ public:
|
||||
|
||||
void reserve(size_type res_arg)
|
||||
{
|
||||
if (res_arg <= capacity())
|
||||
size_type cap = capacity();
|
||||
if (res_arg <= cap)
|
||||
{
|
||||
// @@@ insert shrinkage here if you wish
|
||||
return;
|
||||
}
|
||||
|
||||
if (pData_ == &emptyString_)
|
||||
if (cap == 0)
|
||||
{
|
||||
Init(0, res_arg);
|
||||
}
|
||||
@@ -519,7 +510,7 @@ public:
|
||||
|
||||
const E* c_str() const
|
||||
{
|
||||
if (pData_ != &emptyString_) *pData_->pEnd_ = E();
|
||||
if (capacity() > 0) *pData_->pEnd_ = E();
|
||||
return pData_->buffer_;
|
||||
}
|
||||
|
||||
@@ -544,26 +535,18 @@ SimpleStringStorage<E, A>::emptyString_ =
|
||||
template <typename E, class A = std::allocator<E> >
|
||||
class AllocatorStringStorage : public A
|
||||
{
|
||||
typedef typename A::size_type size_type;
|
||||
typedef typename boost::allocator_size_type<A>::type size_type;
|
||||
typedef typename SimpleStringStorage<E, A>::Data Data;
|
||||
|
||||
void* Alloc(size_type sz, const void* p = 0)
|
||||
{
|
||||
return A::allocate(1 + (sz - 1) / sizeof(E),
|
||||
return boost::allocator_allocate(static_cast<A&>(*this), 1 + (sz - 1) / sizeof(E),
|
||||
static_cast<const char*>(p));
|
||||
}
|
||||
|
||||
void* Realloc(void* p, size_type oldSz, size_type newSz)
|
||||
{
|
||||
void* r = Alloc(newSz);
|
||||
flex_string_details::pod_copy(p, p + Min(oldSz, newSz), r);
|
||||
Free(p, oldSz);
|
||||
return r;
|
||||
}
|
||||
|
||||
void Free(void* p, size_type sz)
|
||||
{
|
||||
A::deallocate(static_cast<E*>(p), sz);
|
||||
boost::allocator_deallocate(static_cast<A&>(*this), static_cast<E*>(p), sz);
|
||||
}
|
||||
|
||||
Data* pData_;
|
||||
@@ -645,6 +628,7 @@ public:
|
||||
{
|
||||
if (capacity())
|
||||
{
|
||||
BOOST_WAVE_COMPILE_TIME_ASSERT(pData_ != (&SimpleStringStorage<E, A>::emptyString_));
|
||||
Free(pData_,
|
||||
sizeof(Data) + capacity() * sizeof(E));
|
||||
}
|
||||
@@ -666,7 +650,7 @@ public:
|
||||
{ return size_type(end() - begin()); }
|
||||
|
||||
size_type max_size() const
|
||||
{ return A::max_size(); }
|
||||
{ return boost::allocator_max_size(static_cast<const A&>(*this)); }
|
||||
|
||||
size_type capacity() const
|
||||
{ return size_type(pData_->pEndOfMem_ - pData_->buffer_); }
|
||||
@@ -727,7 +711,7 @@ public:
|
||||
|
||||
const E* c_str() const
|
||||
{
|
||||
if (pData_ != &SimpleStringStorage<E, A>::emptyString_)
|
||||
if (capacity() > 0)
|
||||
{
|
||||
*pData_->pEnd_ = E();
|
||||
}
|
||||
@@ -757,7 +741,7 @@ public: // protected:
|
||||
typedef typename base::iterator iterator;
|
||||
typedef typename base::const_iterator const_iterator;
|
||||
typedef A allocator_type;
|
||||
typedef typename A::size_type size_type;
|
||||
typedef typename boost::allocator_size_type<A>::type size_type;
|
||||
|
||||
VectorStringStorage(const VectorStringStorage& s) : base(s)
|
||||
{ }
|
||||
@@ -874,7 +858,7 @@ public:
|
||||
typedef value_type* iterator;
|
||||
typedef const value_type* const_iterator;
|
||||
typedef typename Storage::allocator_type allocator_type;
|
||||
typedef typename allocator_type::size_type size_type;
|
||||
typedef typename boost::allocator_size_type<allocator_type>::type size_type;
|
||||
|
||||
private:
|
||||
enum { temp1 = threshold * sizeof(value_type) > sizeof(Storage)
|
||||
@@ -1011,7 +995,7 @@ public:
|
||||
}
|
||||
|
||||
size_type max_size() const
|
||||
{ return get_allocator().max_size(); }
|
||||
{ return boost::allocator_max_size(get_allocator()); }
|
||||
|
||||
size_type capacity() const
|
||||
{ return Small() ? maxSmallString : GetStorage().capacity(); }
|
||||
@@ -1201,8 +1185,8 @@ public:
|
||||
typedef typename Storage::iterator iterator;
|
||||
typedef typename Storage::const_iterator const_iterator;
|
||||
typedef typename Storage::allocator_type allocator_type;
|
||||
typedef typename allocator_type::size_type size_type;
|
||||
typedef typename Storage::reference reference;
|
||||
typedef typename boost::allocator_size_type<allocator_type>::type size_type;
|
||||
typedef typename Storage::value_type& reference;
|
||||
|
||||
private:
|
||||
union
|
||||
@@ -1461,13 +1445,12 @@ public:
|
||||
typedef T traits_type;
|
||||
typedef typename traits_type::char_type value_type;
|
||||
typedef A allocator_type;
|
||||
typedef typename A::size_type size_type;
|
||||
typedef typename A::difference_type difference_type;
|
||||
|
||||
typedef typename A::reference reference;
|
||||
typedef typename A::const_reference const_reference;
|
||||
typedef typename A::pointer pointer;
|
||||
typedef typename A::const_pointer const_pointer;
|
||||
typedef typename boost::allocator_value_type<A>::type& reference;
|
||||
typedef typename boost::allocator_value_type<A>::type const& const_reference;
|
||||
typedef typename boost::allocator_pointer<A>::type pointer;
|
||||
typedef typename boost::allocator_const_pointer<A>::type const_pointer;
|
||||
typedef typename boost::allocator_size_type<A>::type size_type;
|
||||
|
||||
typedef typename Storage::iterator iterator;
|
||||
typedef typename Storage::const_iterator const_iterator;
|
||||
@@ -1802,13 +1785,13 @@ private:
|
||||
if(!empty() && beginIterator != endIterator)
|
||||
{
|
||||
typedef const typename std::iterator_traits<Iterator>::value_type *
|
||||
pointer;
|
||||
value_pointer;
|
||||
|
||||
pointer myBegin(&*begin());
|
||||
pointer myEnd(&*begin() + size());
|
||||
pointer rangeBegin(DereferenceValidIterator(beginIterator));
|
||||
value_pointer myBegin(&*begin());
|
||||
value_pointer myEnd(&*begin() + size());
|
||||
value_pointer rangeBegin(DereferenceValidIterator(beginIterator));
|
||||
|
||||
const std::less_equal<pointer> less_equal = std::less_equal<pointer>();
|
||||
const std::less_equal<value_pointer> less_equal = std::less_equal<value_pointer>();
|
||||
if(less_equal(myBegin, rangeBegin) && less_equal(rangeBegin, myEnd))
|
||||
return true;
|
||||
}
|
||||
@@ -2059,7 +2042,7 @@ private:
|
||||
i2 - i1;
|
||||
BOOST_ASSERT(n1 >= 0);
|
||||
const typename std::iterator_traits<FwdIterator>::difference_type n2 =
|
||||
std::distance(s1, s2);
|
||||
std::distance(s1, s2);
|
||||
BOOST_ASSERT(n2 >= 0);
|
||||
|
||||
if (IsAliasedRange(s1, s2))
|
||||
@@ -2601,4 +2584,4 @@ inline void serialize(Archive & ar, boost::wave::util::flex_string<E, T, A, S> &
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // FLEX_STRING_INC_
|
||||
#endif // BOOST_FLEX_STRING_INC_
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(FUNCTOR_INPUT_HPP_ED3A4C21_8F8A_453F_B438_08214FAC106A_INCLUDED)
|
||||
#define FUNCTOR_INPUT_HPP_ED3A4C21_8F8A_453F_B438_08214FAC106A_INCLUDED
|
||||
#if !defined(BOOST_FUNCTOR_INPUT_HPP_ED3A4C21_8F8A_453F_B438_08214FAC106A_INCLUDED)
|
||||
#define BOOST_FUNCTOR_INPUT_HPP_ED3A4C21_8F8A_453F_B438_08214FAC106A_INCLUDED
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/spirit/include/classic_multi_pass.hpp>
|
||||
@@ -63,11 +63,11 @@ struct functor_input {
|
||||
bool was_initialized;
|
||||
};
|
||||
|
||||
// Needed by compilers not implementing the resolution to DR45. For
|
||||
// reference, see
|
||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#45.
|
||||
// Needed by compilers not implementing the resolution to DR45. For
|
||||
// reference, see
|
||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#45.
|
||||
|
||||
friend struct Data;
|
||||
friend struct Data;
|
||||
|
||||
public:
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
@@ -152,4 +152,4 @@ struct functor_input {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(FUNCTOR_INPUT_HPP_ED3A4C21_8F8A_453F_B438_08214FAC106A_INCLUDED)
|
||||
#endif // !defined(BOOST_FUNCTOR_INPUT_HPP_ED3A4C21_8F8A_453F_B438_08214FAC106A_INCLUDED)
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
Software License, Version 1.0. (See accompanying file
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
#if !defined(INSERT_WHITESPACE_DETECTION_HPP_765EF77B_0513_4967_BDD6_6A38148C4C96_INCLUDED)
|
||||
#define INSERT_WHITESPACE_DETECTION_HPP_765EF77B_0513_4967_BDD6_6A38148C4C96_INCLUDED
|
||||
#if !defined(BOOST_INSERT_WHITESPACE_DETECTION_HPP_765EF77B_0513_4967_BDD6_6A38148C4C96_INCLUDED)
|
||||
#define BOOST_INSERT_WHITESPACE_DETECTION_HPP_765EF77B_0513_4967_BDD6_6A38148C4C96_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/token_ids.hpp>
|
||||
@@ -545,4 +545,4 @@ private:
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(INSERT_WHITESPACE_DETECTION_HPP_765EF77B_0513_4967_BDD6_6A38148C4C96_INCLUDED)
|
||||
#endif // !defined(BOOST_INSERT_WHITESPACE_DETECTION_HPP_765EF77B_0513_4967_BDD6_6A38148C4C96_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(INTERPRET_PRAGMA_HPP_B1F2315E_C5CE_4ED1_A343_0EF548B7942A_INCLUDED)
|
||||
#define INTERPRET_PRAGMA_HPP_B1F2315E_C5CE_4ED1_A343_0EF548B7942A_INCLUDED
|
||||
#if !defined(BOOST_INTERPRET_PRAGMA_HPP_B1F2315E_C5CE_4ED1_A343_0EF548B7942A_INCLUDED)
|
||||
#define BOOST_INTERPRET_PRAGMA_HPP_B1F2315E_C5CE_4ED1_A343_0EF548B7942A_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
@@ -115,7 +115,7 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token,
|
||||
return false;
|
||||
}
|
||||
|
||||
// remove the falsely matched surrounding parenthesis's
|
||||
// remove the falsely matched surrounding parenthesis's
|
||||
if (values.size() >= 2) {
|
||||
BOOST_ASSERT(T_LEFTPAREN == values.front() && T_RIGHTPAREN == values.back());
|
||||
values.erase(values.begin());
|
||||
@@ -123,12 +123,12 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token,
|
||||
values.erase((++rit).base());
|
||||
}
|
||||
|
||||
// decode the option (call the context_policy hook)
|
||||
// decode the option (call the context_policy hook)
|
||||
if (!ctx.get_hooks().interpret_pragma(
|
||||
ctx.derived(), pending, option, values, act_token))
|
||||
{
|
||||
// unknown #pragma option
|
||||
string_type option_str ((*it).get_value());
|
||||
// unknown #pragma option
|
||||
string_type option_str((*it).get_value());
|
||||
|
||||
option_str += option.get_value();
|
||||
if (values.size() > 0) {
|
||||
@@ -145,13 +145,13 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token,
|
||||
}
|
||||
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
|
||||
else if ((*it).get_value() == "once") {
|
||||
// #pragma once
|
||||
// #pragma once
|
||||
return ctx.add_pragma_once_header(act_token, ctx.get_current_filename());
|
||||
}
|
||||
#endif
|
||||
#if BOOST_WAVE_SUPPORT_PRAGMA_MESSAGE != 0
|
||||
else if ((*it).get_value() == "message") {
|
||||
// #pragma message(...) or #pragma message ...
|
||||
// #pragma message(...) or #pragma message ...
|
||||
using namespace boost::spirit::classic;
|
||||
ContainerT values;
|
||||
|
||||
@@ -178,14 +178,14 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token,
|
||||
return false;
|
||||
}
|
||||
|
||||
// remove the falsely matched closing parenthesis/newline
|
||||
// remove the falsely matched closing parenthesis/newline
|
||||
if (values.size() > 0) {
|
||||
BOOST_ASSERT(T_RIGHTPAREN == values.back() || T_NEWLINE == values.back());
|
||||
typename ContainerT::reverse_iterator rit = values.rbegin();
|
||||
values.erase((++rit).base());
|
||||
}
|
||||
|
||||
// output the message itself
|
||||
// output the message itself
|
||||
typename ContextT::string_type msg(impl::as_string(values));
|
||||
BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
|
||||
pragma_message_directive,
|
||||
@@ -207,4 +207,4 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token,
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(INTERPRET_PRAGMA_HPP_B1F2315E_C5CE_4ED1_A343_0EF548B7942A_INCLUDED)
|
||||
#endif // !defined(BOOST_INTERPRET_PRAGMA_HPP_B1F2315E_C5CE_4ED1_A343_0EF548B7942A_INCLUDED)
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(ITERATION_CONTEXT_HPP_9556CD16_F11E_4ADC_AC8B_FB9A174BE664_INCLUDED)
|
||||
#define ITERATION_CONTEXT_HPP_9556CD16_F11E_4ADC_AC8B_FB9A174BE664_INCLUDED
|
||||
#if !defined(BOOST_ITERATION_CONTEXT_HPP_9556CD16_F11E_4ADC_AC8B_FB9A174BE664_INCLUDED)
|
||||
#define BOOST_ITERATION_CONTEXT_HPP_9556CD16_F11E_4ADC_AC8B_FB9A174BE664_INCLUDED
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
#include <stack>
|
||||
#include <string>
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/cpp_exceptions.hpp>
|
||||
@@ -55,12 +55,9 @@ public:
|
||||
typename base_type::value_type const &val)
|
||||
{
|
||||
if (iter_ctx.size() == max_include_nesting_depth) {
|
||||
char buffer[22]; // 21 bytes holds all NUL-terminated unsigned 64-bit numbers
|
||||
|
||||
using namespace std; // for some systems sprintf is in namespace std
|
||||
sprintf(buffer, "%d", (int)max_include_nesting_depth);
|
||||
std::string buffer = std::to_string(max_include_nesting_depth);
|
||||
BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
|
||||
include_nesting_too_deep, buffer, pos);
|
||||
include_nesting_too_deep, buffer.c_str(), pos);
|
||||
}
|
||||
iter_ctx.push(val);
|
||||
}
|
||||
@@ -80,4 +77,4 @@ private:
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(ITERATION_CONTEXT_HPP_9556CD16_F11E_4ADC_AC8B_FB9A174BE664_INCLUDED)
|
||||
#endif // !defined(BOOST_ITERATION_CONTEXT_HPP_9556CD16_F11E_4ADC_AC8B_FB9A174BE664_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(MACRO_DEFINITION_HPP_D68A639E_2DA5_4E9C_8ACD_CFE6B903831E_INCLUDED)
|
||||
#define MACRO_DEFINITION_HPP_D68A639E_2DA5_4E9C_8ACD_CFE6B903831E_INCLUDED
|
||||
#if !defined(BOOST_MACRO_DEFINITION_HPP_D68A639E_2DA5_4E9C_8ACD_CFE6B903831E_INCLUDED)
|
||||
#define BOOST_MACRO_DEFINITION_HPP_D68A639E_2DA5_4E9C_8ACD_CFE6B903831E_INCLUDED
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
@@ -73,16 +73,17 @@ struct macro_definition {
|
||||
// with special parameter tokens to simplify later macro replacement.
|
||||
// Additionally mark all occurrences of the macro name itself throughout
|
||||
// the macro definition
|
||||
void replace_parameters()
|
||||
template<typename ContextT>
|
||||
void replace_parameters(ContextT const & ctx)
|
||||
{
|
||||
using namespace boost::wave;
|
||||
|
||||
if (!replaced_parameters) {
|
||||
typename definition_container_type::iterator end = macrodefinition.end();
|
||||
typename definition_container_type::iterator it = macrodefinition.begin();
|
||||
typename definition_container_type::iterator end = macrodefinition.end();
|
||||
typename definition_container_type::iterator it = macrodefinition.begin();
|
||||
|
||||
for (/**/; it != end; ++it) {
|
||||
token_id id = *it;
|
||||
token_id id = *it;
|
||||
|
||||
if (T_IDENTIFIER == id ||
|
||||
IS_CATEGORY(id, KeywordTokenType) ||
|
||||
@@ -100,20 +101,31 @@ struct macro_definition {
|
||||
break;
|
||||
}
|
||||
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
|
||||
else if (T_ELLIPSIS == token_id(*cit) &&
|
||||
else if (need_variadics(ctx.get_language()) &&
|
||||
T_ELLIPSIS == token_id(*cit) &&
|
||||
"__VA_ARGS__" == (*it).get_value())
|
||||
{
|
||||
// __VA_ARGS__ requires special handling
|
||||
(*it).set_token_id(token_id(T_EXTPARAMETERBASE+i));
|
||||
break;
|
||||
}
|
||||
#if BOOST_WAVE_SUPPORT_VA_OPT != 0
|
||||
else if (need_va_opt(ctx.get_language()) &&
|
||||
T_ELLIPSIS == token_id(*cit) &&
|
||||
"__VA_OPT__" == (*it).get_value())
|
||||
{
|
||||
// __VA_OPT__ also requires related special handling
|
||||
(*it).set_token_id(token_id(T_OPTPARAMETERBASE+i));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
|
||||
// we need to know, if the last of the formal arguments is an ellipsis
|
||||
// we need to know, if the last of the formal arguments is an ellipsis
|
||||
if (macroparameters.size() > 0 &&
|
||||
T_ELLIPSIS == token_id(macroparameters.back()))
|
||||
{
|
||||
@@ -197,4 +209,4 @@ intrusive_ptr_release(macro_definition<TokenT, ContainerT>* p)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(MACRO_DEFINITION_HPP_D68A639E_2DA5_4E9C_8ACD_CFE6B903831E_INCLUDED)
|
||||
#endif // !defined(BOOST_MACRO_DEFINITION_HPP_D68A639E_2DA5_4E9C_8ACD_CFE6B903831E_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(MACRO_HELPERS_HPP_931BBC99_EBFA_4692_8FBE_B555998C2C39_INCLUDED)
|
||||
#define MACRO_HELPERS_HPP_931BBC99_EBFA_4692_8FBE_B555998C2C39_INCLUDED
|
||||
#if !defined(BOOST_MACRO_HELPERS_HPP_931BBC99_EBFA_4692_8FBE_B555998C2C39_INCLUDED)
|
||||
#define BOOST_MACRO_HELPERS_HPP_931BBC99_EBFA_4692_8FBE_B555998C2C39_INCLUDED
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -252,6 +252,48 @@ namespace impl {
|
||||
expanded.push_back(comma);
|
||||
}
|
||||
}
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_VA_OPT != 0
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Finds the token range inside __VA_OPT__.
|
||||
// Updates mdit to the position of the final rparen.
|
||||
// If the parenthesis do not match up, or there are none, returns false
|
||||
// and leaves mdit unchanged.
|
||||
//
|
||||
template <typename MDefIterT>
|
||||
bool find_va_opt_args (
|
||||
MDefIterT & mdit, // VA_OPT
|
||||
MDefIterT mdend)
|
||||
{
|
||||
if ((std::distance(mdit, mdend) < 3) ||
|
||||
(T_LEFTPAREN != next_token<MDefIterT>::peek(mdit, mdend))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
MDefIterT mdstart_it = mdit;
|
||||
++mdit; // skip to lparen
|
||||
std::size_t scope = 0;
|
||||
// search for final rparen, leaving iterator there
|
||||
for (; (mdit != mdend) && !((scope == 1) && (T_RIGHTPAREN == token_id(*mdit)));
|
||||
++mdit) {
|
||||
// count balanced parens
|
||||
if (T_RIGHTPAREN == token_id(*mdit)) {
|
||||
scope--;
|
||||
} else if (T_LEFTPAREN == token_id(*mdit)) {
|
||||
scope++;
|
||||
}
|
||||
}
|
||||
if ((mdit == mdend) && ((scope != 1) || (T_RIGHTPAREN != token_id(*mdit)))) {
|
||||
// arrived at end without matching rparen
|
||||
mdit = mdstart_it;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Skip all whitespace characters and queue the skipped characters into the
|
||||
@@ -288,6 +330,20 @@ namespace impl {
|
||||
return id;
|
||||
}
|
||||
|
||||
// trim all whitespace from the beginning and the end of the given string
|
||||
template <typename StringT>
|
||||
inline StringT
|
||||
trim_whitespace(StringT const &s)
|
||||
{
|
||||
typedef typename StringT::size_type size_type;
|
||||
|
||||
size_type first = s.find_first_not_of(" \t\v\f");
|
||||
if (StringT::npos == first)
|
||||
return StringT();
|
||||
size_type last = s.find_last_not_of(" \t\v\f");
|
||||
return s.substr(first, last-first+1);
|
||||
}
|
||||
|
||||
} // namespace impl
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -300,4 +356,4 @@ namespace impl {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(MACRO_HELPERS_HPP_931BBC99_EBFA_4692_8FBE_B555998C2C39_INCLUDED)
|
||||
#endif // !defined(BOOST_MACRO_HELPERS_HPP_931BBC99_EBFA_4692_8FBE_B555998C2C39_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(SYMBOL_TABLE_HPP_32B0F7C6_3DD6_4113_95A5_E16516C6F45A_INCLUDED)
|
||||
#define SYMBOL_TABLE_HPP_32B0F7C6_3DD6_4113_95A5_E16516C6F45A_INCLUDED
|
||||
#if !defined(BOOST_SYMBOL_TABLE_HPP_32B0F7C6_3DD6_4113_95A5_E16516C6F45A_INCLUDED)
|
||||
#define BOOST_SYMBOL_TABLE_HPP_32B0F7C6_3DD6_4113_95A5_E16516C6F45A_INCLUDED
|
||||
|
||||
#include <map>
|
||||
|
||||
@@ -117,4 +117,4 @@ public:
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(SYMBOL_TABLE_HPP_32B0F7C6_3DD6_4113_95A5_E16516C6F45A_INCLUDED)
|
||||
#endif // !defined(BOOST_SYMBOL_TABLE_HPP_32B0F7C6_3DD6_4113_95A5_E16516C6F45A_INCLUDED)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*=============================================================================
|
||||
/*=============================================================================
|
||||
Boost.Wave: A Standard compliant C++ preprocessor library
|
||||
|
||||
http://www.boost.org/
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(TIME_CONVERSION_HELPER_HPP_DA97E389_1797_43BA_82AE_B071064B3EF4_INCLUDED)
|
||||
#define TIME_CONVERSION_HELPER_HPP_DA97E389_1797_43BA_82AE_B071064B3EF4_INCLUDED
|
||||
#if !defined(BOOST_TIME_CONVERSION_HELPER_HPP_DA97E389_1797_43BA_82AE_B071064B3EF4_INCLUDED)
|
||||
#define BOOST_TIME_CONVERSION_HELPER_HPP_DA97E389_1797_43BA_82AE_B071064B3EF4_INCLUDED
|
||||
|
||||
#include <ctime>
|
||||
#include <cstring>
|
||||
@@ -150,4 +150,4 @@ using namespace time_conversion;
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(TIME_CONVERSION_HELPER_HPP_DA97E389_1797_43BA_82AE_B071064B3EF4_INCLUDED)
|
||||
#endif // !defined(BOOST_TIME_CONVERSION_HELPER_HPP_DA97E389_1797_43BA_82AE_B071064B3EF4_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(TRANSFORM_ITERATOR_HPP_D492C659_88C7_4258_8C42_192F9AE80EC0_INCLUDED)
|
||||
#define TRANSFORM_ITERATOR_HPP_D492C659_88C7_4258_8C42_192F9AE80EC0_INCLUDED
|
||||
#if !defined(BOOST_TRANSFORM_ITERATOR_HPP_D492C659_88C7_4258_8C42_192F9AE80EC0_INCLUDED)
|
||||
#define BOOST_TRANSFORM_ITERATOR_HPP_D492C659_88C7_4258_8C42_192F9AE80EC0_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/iterator_adaptors.hpp>
|
||||
@@ -86,4 +86,4 @@ namespace impl {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(TRANSFORM_ITERATOR_HPP_D492C659_88C7_4258_8C42_192F9AE80EC0_INCLUDED)
|
||||
#endif // !defined(BOOST_TRANSFORM_ITERATOR_HPP_D492C659_88C7_4258_8C42_192F9AE80EC0_INCLUDED)
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
Software License, Version 1.0. (See accompanying file
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
#if !defined(UNPUT_QUEUE_ITERATOR_HPP_76DA23D0_4893_4AD5_ABCC_6CED7CFB89BC_INCLUDED)
|
||||
#define UNPUT_QUEUE_ITERATOR_HPP_76DA23D0_4893_4AD5_ABCC_6CED7CFB89BC_INCLUDED
|
||||
#if !defined(BOOST_UNPUT_QUEUE_ITERATOR_HPP_76DA23D0_4893_4AD5_ABCC_6CED7CFB89BC_INCLUDED)
|
||||
#define BOOST_UNPUT_QUEUE_ITERATOR_HPP_76DA23D0_4893_4AD5_ABCC_6CED7CFB89BC_INCLUDED
|
||||
|
||||
#include <list>
|
||||
|
||||
@@ -88,11 +88,11 @@ public:
|
||||
void increment()
|
||||
{
|
||||
if (!unput_queue.empty()) {
|
||||
// there exist pending tokens in the unput queue
|
||||
// there exist pending tokens in the unput queue
|
||||
unput_queue.pop_front();
|
||||
}
|
||||
else {
|
||||
// the unput_queue is empty, so advance the base iterator
|
||||
// the unput_queue is empty, so advance the base iterator
|
||||
++base_type::base_reference();
|
||||
}
|
||||
}
|
||||
@@ -292,4 +292,4 @@ namespace impl {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(UNPUT_QUEUE_ITERATOR_HPP_76DA23D0_4893_4AD5_ABCC_6CED7CFB89BC_INCLUDED)
|
||||
#endif // !defined(BOOST_UNPUT_QUEUE_ITERATOR_HPP_76DA23D0_4893_4AD5_ABCC_6CED7CFB89BC_INCLUDED)
|
||||
|
||||
Reference in New Issue
Block a user