From 326918c41ac1988e373d2aa5edb0ab68e735070c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Dec 2017 11:02:19 +0200 Subject: Add support for VC 15u5 --- libbutl/regex.cxx | 8 ++++++-- tests/base64/driver.cxx | 2 +- tests/regex/driver.cxx | 5 +++++ tests/timestamp/driver.cxx | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/libbutl/regex.cxx b/libbutl/regex.cxx index 6159d54..e4fd009 100644 --- a/libbutl/regex.cxx +++ b/libbutl/regex.cxx @@ -15,7 +15,7 @@ #include #include #include // runtime_error -#if defined(_MSC_VER) && _MSC_VER <= 1911 +#if defined(_MSC_VER) && _MSC_VER <= 1912 # include // strstr() #endif #endif @@ -52,7 +52,11 @@ namespace std { const char* d (e.what ()); -#if defined(_MSC_VER) && _MSC_VER <= 1911 +#if defined(_MSC_VER) && _MSC_VER <= 1912 + // Note: run the regex test like this to check new VC version: + // + // ./driver.exe a '{' b + // const char* rd (strstr (d, "): ")); if (rd != nullptr) d = rd + 3; diff --git a/tests/base64/driver.cxx b/tests/base64/driver.cxx index fb65a49..195eaf0 100644 --- a/tests/base64/driver.cxx +++ b/tests/base64/driver.cxx @@ -40,7 +40,7 @@ encode (const string& i, const string& o) // VC15 seekg() doesn't clear eofbit. // -#if defined(_MSC_VER) && _MSC_VER <= 1911 +#if defined(_MSC_VER) && _MSC_VER <= 1912 is.clear (); #endif diff --git a/tests/regex/driver.cxx b/tests/regex/driver.cxx index 3f6129a..5e96f06 100644 --- a/tests/regex/driver.cxx +++ b/tests/regex/driver.cxx @@ -74,6 +74,11 @@ try return r.second ? 0 : 1; } +catch (const regex_error& e) +{ + cerr << "invalid regex" << e << endl; // Print sanitized. + return 2; +} catch (const exception& e) { cerr << e << endl; diff --git a/tests/timestamp/driver.cxx b/tests/timestamp/driver.cxx index ec4c49d..cdaaaec 100644 --- a/tests/timestamp/driver.cxx +++ b/tests/timestamp/driver.cxx @@ -133,7 +133,7 @@ main () // "Apr 19:31:10 2016" for the format "%b %d %H:%M:%S %Y" as if the input were // "Apr 19 00:31:10 2016". // -#if !defined(_MSC_VER) || _MSC_VER > 1911 +#if !defined(_MSC_VER) || _MSC_VER > 1912 assert (fail ("Apr 19:31:10 2016", "%b %d %H:%M:%S %Y")); assert (fail (":31 2016", "%H:%M %Y")); #endif -- cgit v1.1