mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 21:34:46 +02:00
Fix portability issues for building tests in MinGW
This commit is contained in:
committed by
Mohammad Nejati
parent
916dcf8eb3
commit
16f94633b1
@@ -16,7 +16,6 @@
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
@@ -43,7 +42,7 @@ test_file()
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
static constexpr
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__)
|
||||
boost::winapi::WCHAR_ unicode_suffix[] = { 0xd83e, 0xdd84, 0x0000 }; // UTF-16-LE unicorn
|
||||
#else
|
||||
char unicode_suffix[] = { '\xf0', '\x9f', '\xa6', '\x84', '\x00' }; // UTF-8 unicorn
|
||||
@@ -112,8 +111,8 @@ test_file()
|
||||
[](fs::path const& path)
|
||||
{
|
||||
// no exceptions - failure will result in an empty string
|
||||
std::ifstream in;
|
||||
in.open(path.native());
|
||||
fs::ifstream in;
|
||||
in.open(path);
|
||||
noskipws(in);
|
||||
auto s = std::string(
|
||||
std::istream_iterator<char>(in),
|
||||
|
@@ -168,7 +168,7 @@ public:
|
||||
"0123456789"; // 40
|
||||
// create the temporary file
|
||||
{
|
||||
std::ofstream fstemp(temp.path().native());
|
||||
std::ofstream fstemp(temp.path().string());
|
||||
std::size_t written = 0;
|
||||
std::size_t to_write = 4097;
|
||||
while (written < to_write)
|
||||
@@ -223,7 +223,7 @@ public:
|
||||
"0123456789"; // 40
|
||||
// create the temporary file
|
||||
{
|
||||
std::ofstream fstemp(temp.path().native());
|
||||
std::ofstream fstemp(temp.path().string());
|
||||
std::size_t written = 0;
|
||||
std::size_t to_write = 2048;
|
||||
while (written < to_write)
|
||||
|
Reference in New Issue
Block a user