Work around various GCC 4.9 build errors
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337665 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -72,6 +72,7 @@ static std::string format_string_imp(const char* msg, ...) {
|
|||||||
struct GuardVAList {
|
struct GuardVAList {
|
||||||
va_list& target;
|
va_list& target;
|
||||||
bool active = true;
|
bool active = true;
|
||||||
|
GuardVAList(va_list &target) : target(target), active(true) {}
|
||||||
void clear() {
|
void clear() {
|
||||||
if (active)
|
if (active)
|
||||||
va_end(target);
|
va_end(target);
|
||||||
@@ -84,11 +85,11 @@ static std::string format_string_imp(const char* msg, ...) {
|
|||||||
};
|
};
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, msg);
|
va_start(args, msg);
|
||||||
GuardVAList args_guard = {args};
|
GuardVAList args_guard(args);
|
||||||
|
|
||||||
va_list args_cp;
|
va_list args_cp;
|
||||||
va_copy(args_cp, args);
|
va_copy(args_cp, args);
|
||||||
GuardVAList args_copy_guard = {args_cp};
|
GuardVAList args_copy_guard(args_cp);
|
||||||
|
|
||||||
std::array<char, 256> local_buff;
|
std::array<char, 256> local_buff;
|
||||||
std::size_t size = local_buff.size();
|
std::size_t size = local_buff.size();
|
||||||
@@ -131,7 +132,7 @@ std::error_code capture_errno() {
|
|||||||
template <class T>
|
template <class T>
|
||||||
T error_value();
|
T error_value();
|
||||||
template <>
|
template <>
|
||||||
constexpr void error_value<void>() {}
|
_LIBCPP_CONSTEXPR_AFTER_CXX11 void error_value<void>() {}
|
||||||
template <>
|
template <>
|
||||||
constexpr bool error_value<bool>() {
|
constexpr bool error_value<bool>() {
|
||||||
return false;
|
return false;
|
||||||
@@ -141,7 +142,7 @@ constexpr uintmax_t error_value<uintmax_t>() {
|
|||||||
return uintmax_t(-1);
|
return uintmax_t(-1);
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
constexpr file_time_type error_value<file_time_type>() {
|
_LIBCPP_CONSTEXPR_AFTER_CXX11 file_time_type error_value<file_time_type>() {
|
||||||
return file_time_type::min();
|
return file_time_type::min();
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
@@ -369,7 +370,7 @@ TimeSpec extract_atime(StatT const& st) { return st.st_atim; }
|
|||||||
using TimeStruct = struct ::timeval;
|
using TimeStruct = struct ::timeval;
|
||||||
using TimeStructArray = TimeStruct[2];
|
using TimeStructArray = TimeStruct[2];
|
||||||
#else
|
#else
|
||||||
using TimeStruct = struct ::timespec;
|
using TimeStruct = TimeSpec;
|
||||||
using TimeStructArray = TimeStruct[2];
|
using TimeStructArray = TimeStruct[2];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -413,8 +414,6 @@ bool SetTimeStructTo(TimeStruct& TS, file_time_type NewTime) {
|
|||||||
|
|
||||||
_LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM
|
_LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // FILESYSTEM_COMMON_H
|
#endif // FILESYSTEM_COMMON_H
|
||||||
|
|||||||
@@ -36,6 +36,12 @@
|
|||||||
# define _LIBCPP_USE_COPYFILE
|
# define _LIBCPP_USE_COPYFILE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(_LIBCPP_COMPILER_GCC)
|
||||||
|
#if _GNUC_VER < 500
|
||||||
|
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM
|
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM
|
||||||
|
|
||||||
filesystem_error::~filesystem_error() {}
|
filesystem_error::~filesystem_error() {}
|
||||||
@@ -446,7 +452,7 @@ bool stat_equivalent(const StatT& st1, const StatT& st2) {
|
|||||||
file_status FileDescriptor::refresh_status(std::error_code& ec) {
|
file_status FileDescriptor::refresh_status(std::error_code& ec) {
|
||||||
// FD must be open and good.
|
// FD must be open and good.
|
||||||
m_status = file_status{};
|
m_status = file_status{};
|
||||||
m_stat = StatT{};
|
m_stat = {};
|
||||||
std::error_code m_ec;
|
std::error_code m_ec;
|
||||||
if (::fstat(fd, &m_stat) == -1)
|
if (::fstat(fd, &m_stat) == -1)
|
||||||
m_ec = capture_errno();
|
m_ec = capture_errno();
|
||||||
|
|||||||
Reference in New Issue
Block a user