Suppress msvc warnings.

Fixes: https://github.com/boostorg/regex/issues/80
This commit is contained in:
jzmaddock
2020-01-20 19:51:46 +00:00
parent 3b98dc901a
commit 2cd947f7c4
19 changed files with 150 additions and 28 deletions

View File

@ -70,6 +70,10 @@ inline std::string to_string(const char* i, const char* j)
}
namespace BOOST_REGEX_DETAIL_NS{
#ifdef BOOST_MSVC
# pragma warning(push)
#pragma warning(disable:26812)
#endif
class RegExData
{
public:
@ -103,6 +107,9 @@ public:
#endif
strings(), positions() {}
};
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
void RegExData::update()
{

View File

@ -112,16 +112,21 @@ void mapfile::open(const char* file)
std::runtime_error err("Unable to create file mapping.");
boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
}
_first = static_cast<const char*>(MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0));
if(_first == 0)
else
{
CloseHandle(hmap);
CloseHandle(hfile);
hmap = 0;
hfile = 0;
std::runtime_error err("Unable to create file mapping.");
_first = static_cast<const char*>(MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0));
if (_first == 0)
{
CloseHandle(hmap);
CloseHandle(hfile);
hmap = 0;
hfile = 0;
std::runtime_error err("Unable to create file mapping.");
boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
}
else
_last = _first + GetFileSize(hfile, 0);
}
_last = _first + GetFileSize(hfile, 0);
}
else
{

View File

@ -66,6 +66,10 @@ const char* names[] = {
typedef boost::basic_regex<char, c_regex_traits<char> > c_regex_type;
#ifdef BOOST_MSVC
# pragma warning(push)
#pragma warning(disable:26812)
#endif
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA* expression, const char* ptr, int f)
{
#ifndef BOOST_NO_EXCEPTIONS
@ -140,6 +144,9 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA* expression, const char
return result;
}
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA* e, char* buf, regsize_t buf_size)
{

View File

@ -72,7 +72,7 @@ regex_error::regex_error(regex_constants::error_type err)
{
}
regex_error::~regex_error() throw()
regex_error::~regex_error() BOOST_NOEXCEPT
{
}

View File

@ -76,6 +76,10 @@ const wchar_t* wnames[] = {
typedef boost::basic_regex<wchar_t, c_regex_traits<wchar_t> > wc_regex_type;
#ifdef BOOST_MSVC
# pragma warning(push)
#pragma warning(disable:26812)
#endif
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wchar_t* ptr, int f)
{
#ifndef BOOST_NO_EXCEPTIONS
@ -150,6 +154,9 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wcha
return result;
}
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW* e, wchar_t* buf, regsize_t buf_size)
{