mirror of
https://github.com/boostorg/beast.git
synced 2025-08-01 22:04:34 +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/path.hpp>
|
||||||
#include <boost/filesystem/operations.hpp>
|
#include <boost/filesystem/operations.hpp>
|
||||||
#include <boost/filesystem/fstream.hpp>
|
#include <boost/filesystem/fstream.hpp>
|
||||||
#include <fstream>
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
@@ -43,7 +42,7 @@ test_file()
|
|||||||
namespace fs = boost::filesystem;
|
namespace fs = boost::filesystem;
|
||||||
|
|
||||||
static constexpr
|
static constexpr
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__)
|
||||||
boost::winapi::WCHAR_ unicode_suffix[] = { 0xd83e, 0xdd84, 0x0000 }; // UTF-16-LE unicorn
|
boost::winapi::WCHAR_ unicode_suffix[] = { 0xd83e, 0xdd84, 0x0000 }; // UTF-16-LE unicorn
|
||||||
#else
|
#else
|
||||||
char unicode_suffix[] = { '\xf0', '\x9f', '\xa6', '\x84', '\x00' }; // UTF-8 unicorn
|
char unicode_suffix[] = { '\xf0', '\x9f', '\xa6', '\x84', '\x00' }; // UTF-8 unicorn
|
||||||
@@ -112,8 +111,8 @@ test_file()
|
|||||||
[](fs::path const& path)
|
[](fs::path const& path)
|
||||||
{
|
{
|
||||||
// no exceptions - failure will result in an empty string
|
// no exceptions - failure will result in an empty string
|
||||||
std::ifstream in;
|
fs::ifstream in;
|
||||||
in.open(path.native());
|
in.open(path);
|
||||||
noskipws(in);
|
noskipws(in);
|
||||||
auto s = std::string(
|
auto s = std::string(
|
||||||
std::istream_iterator<char>(in),
|
std::istream_iterator<char>(in),
|
||||||
|
@@ -168,7 +168,7 @@ public:
|
|||||||
"0123456789"; // 40
|
"0123456789"; // 40
|
||||||
// create the temporary file
|
// create the temporary file
|
||||||
{
|
{
|
||||||
std::ofstream fstemp(temp.path().native());
|
std::ofstream fstemp(temp.path().string());
|
||||||
std::size_t written = 0;
|
std::size_t written = 0;
|
||||||
std::size_t to_write = 4097;
|
std::size_t to_write = 4097;
|
||||||
while (written < to_write)
|
while (written < to_write)
|
||||||
@@ -223,7 +223,7 @@ public:
|
|||||||
"0123456789"; // 40
|
"0123456789"; // 40
|
||||||
// create the temporary file
|
// create the temporary file
|
||||||
{
|
{
|
||||||
std::ofstream fstemp(temp.path().native());
|
std::ofstream fstemp(temp.path().string());
|
||||||
std::size_t written = 0;
|
std::size_t written = 0;
|
||||||
std::size_t to_write = 2048;
|
std::size_t to_write = 2048;
|
||||||
while (written < to_write)
|
while (written < to_write)
|
||||||
|
Reference in New Issue
Block a user