mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 04:47:29 +02:00
@ -10,6 +10,7 @@ Version 91:
|
|||||||
* Set BOOST_ASIO_NO_DEPRECATED
|
* Set BOOST_ASIO_NO_DEPRECATED
|
||||||
* Use Asio array optimization in static_buffer_base
|
* Use Asio array optimization in static_buffer_base
|
||||||
* Rename wstest source file
|
* Rename wstest source file
|
||||||
|
* Use fopen_s on Windows
|
||||||
|
|
||||||
WebSocket:
|
WebSocket:
|
||||||
|
|
||||||
|
@ -10,9 +10,8 @@
|
|||||||
#ifndef BOOST_BEAST_CONFIG_HPP
|
#ifndef BOOST_BEAST_CONFIG_HPP
|
||||||
#define BOOST_BEAST_CONFIG_HPP
|
#define BOOST_BEAST_CONFIG_HPP
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
|
|
||||||
// Available to every header
|
// Available to every header
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <boost/core/ignore_unused.hpp>
|
#include <boost/core/ignore_unused.hpp>
|
||||||
#include <boost/static_assert.hpp>
|
#include <boost/static_assert.hpp>
|
||||||
|
|
||||||
|
@ -96,12 +96,22 @@ open(char const* path, file_mode mode, error_code& ec)
|
|||||||
case file_mode::append_new: s = "abx"; break;
|
case file_mode::append_new: s = "abx"; break;
|
||||||
case file_mode::append_existing: s = "ab"; break;
|
case file_mode::append_existing: s = "ab"; break;
|
||||||
}
|
}
|
||||||
|
#if BOOST_MSVC
|
||||||
|
auto const ev = fopen_s(&f_, path, s);
|
||||||
|
if(ev)
|
||||||
|
{
|
||||||
|
f_ = nullptr;
|
||||||
|
ec.assign(ev, generic_category());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#else
|
||||||
f_ = std::fopen(path, s);
|
f_ = std::fopen(path, s);
|
||||||
if(! f_)
|
if(! f_)
|
||||||
{
|
{
|
||||||
ec.assign(errno, generic_category());
|
ec.assign(errno, generic_category());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
ec.assign(0, ec.category());
|
ec.assign(0, ec.category());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user