Merged latest commit.

This commit is contained in:
Remotion 2018-06-06 23:11:56 +02:00
commit 9a53c1f624
5 changed files with 21 additions and 31 deletions

View File

@ -112,7 +112,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif ()
if (MSVC)
set(PEDANTIC_COMPILE_FLAGS /W4)
set(PEDANTIC_COMPILE_FLAGS /W3)
set(WERROR_FLAG /WX)
endif ()

View File

@ -104,7 +104,7 @@
#if FMT_HAS_CPP_ATTRIBUTE(noreturn)
# define FMT_NORETURN [[noreturn]]
#else
# define FMT_NORETURN /*noreturn*/
# define FMT_NORETURN
#endif
// Check if exceptions are disabled.

View File

@ -146,7 +146,8 @@ FMT_END_NAMESPACE
# define FMT_USE_TRAILING_RETURN 0
#endif
#if FMT_HAS_GXX_CXX11 || FMT_HAS_FEATURE(cxx_rvalue_references) || FMT_MSC_VER >= 1600
#if FMT_HAS_GXX_CXX11 || FMT_HAS_FEATURE(cxx_rvalue_references) || \
FMT_MSC_VER >= 1600
# define FMT_USE_RVALUE_REFERENCES 1
#else
# define FMT_USE_RVALUE_REFERENCES 0
@ -283,18 +284,21 @@ class fp {
typedef uint64_t significand_type;
// All sizes are in bits.
static FMT_CONSTEXPR_DECL const int char_size = std::numeric_limits<unsigned char>::digits;
static FMT_CONSTEXPR_DECL const int char_size =
std::numeric_limits<unsigned char>::digits;
// Subtract 1 to account for an implicit most significant bit in the
// normalized form.
static FMT_CONSTEXPR_DECL const int double_significand_size =
std::numeric_limits<double>::digits - 1;
static FMT_CONSTEXPR_DECL const uint64_t implicit_bit = 1ull << double_significand_size;
static FMT_CONSTEXPR_DECL const uint64_t implicit_bit =
1ull << double_significand_size;
public:
significand_type f;
int e;
static FMT_CONSTEXPR_DECL const int significand_size = sizeof(significand_type) * char_size;
static FMT_CONSTEXPR_DECL const int significand_size =
sizeof(significand_type) * char_size;
fp(uint64_t f, int e): f(f), e(e) {}
@ -1670,13 +1674,6 @@ FMT_CONSTEXPR unsigned parse_nonnegative_int(Iterator &it, ErrorHandler &&eh) {
return value;
}
#if FMT_MSC_VER
// Warns that the compiler cannot generate an assignment operator
// The class has a reference member variable, so this is obviously the case
# pragma warning(push)
# pragma warning(disable: 4512)
#endif
template <typename Char, typename Context>
class custom_formatter: public function<bool> {
private:
@ -1694,10 +1691,6 @@ class custom_formatter: public function<bool> {
bool operator()(T) const { return false; }
};
#if FMT_MSC_VER
# pragma warning(pop)
#endif
template <typename T>
struct is_integer {
enum {

View File

@ -49,10 +49,9 @@ class printf_precision_handler: public function<int> {
}
template <typename T>
typename std::enable_if<!std::is_integral<T>::value, int>::type
operator()(T) {
typename std::enable_if<!std::is_integral<T>::value, int>::type operator()(T) {
FMT_THROW(format_error("precision is not integer"));
return 0; // Silence visual studio
return 0;
}
};
@ -194,7 +193,7 @@ class printf_width_handler: public function<unsigned> {
typename std::enable_if<!std::is_integral<T>::value, unsigned>::type
operator()(T) {
FMT_THROW(format_error("width is not integer"));
return 0; // Silence Visual Studio
return 0;
}
};
} // namespace internal
@ -635,13 +634,8 @@ inline int fprintf(std::FILE *f, string_view format_str, const Args & ... args)
template <typename... Args>
inline int fprintf(std::FILE *f, wstring_view format_str,
const Args & ... args) {
#if FMT_GCC_VERSION && FMT_GCC_VERSION <= 440
return vfprintf<wchar_t>(f, format_str,
make_format_args<typename printf_context<internal::wbuffer>::type>(args...));
#else
return vfprintf(f, format_str,
make_format_args<typename printf_context<internal::wbuffer>::type>(args...));
#endif
}
inline int vprintf(string_view format, printf_args args) {

View File

@ -100,8 +100,6 @@ struct is_range_<T,typename std::conditional<
decltype(internal::declval<T>().end())>,
void>::type> : std::true_type {};
/// tuple_size and tuple_element check.
template <typename T>
class is_tuple_like_ {
@ -180,17 +178,23 @@ FMT_CONSTEXPR const char* format_str_quoted(bool add_space, const Arg&,
FMT_CONSTEXPR const char* format_str_quoted(bool add_space, const char*) {
return add_space ? " '{}'" : "'{}'";
}
FMT_CONSTEXPR const wchar_t* format_str_quoted(bool add_space, const wchar_t*) {
return add_space ? L" '{}'" : L"'{}'";
}
FMT_CONSTEXPR const char* format_str_quoted(bool add_space, const char) {
return add_space ? " '{}'" : "'{}'";
}
FMT_CONSTEXPR const wchar_t* format_str_quoted(bool add_space, const wchar_t) {
return add_space ? L" '{}'" : L"'{}'";
}
} // namespace internal
template <typename T>
struct is_tuple_like {
static FMT_CONSTEXPR_DECL const bool value =
internal::is_tuple_like_<T>::value && !internal::is_range_<T>::value;
internal::is_tuple_like_<T>::value && !internal::is_range_<T>::value;
};
template <typename TupleT, typename Char>
@ -241,11 +245,10 @@ public:
}
};
template <typename T>
struct is_range {
static FMT_CONSTEXPR_DECL const bool value =
internal::is_range_<T>::value && !internal::is_like_std_string<T>::value;
internal::is_range_<T>::value && !internal::is_like_std_string<T>::value;
};
template <typename RangeT, typename Char>