Commit a78a34ea authored by jamesge's avatar jamesge

fix errors with clang++ 11 on MacOS Catalina

parent b1f7ea03
......@@ -37,17 +37,17 @@ class UIFont;
#if __has_extension(cxx_strong_enums) && \
(defined(OS_IOS) || (defined(MAC_OS_X_VERSION_10_8) && \
MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8))
#define CR_FORWARD_ENUM(_type, _name) enum _name : _type _name
#define CR_FORWARD_ENUM(_type, _name) enum _name : _type
#else
#define CR_FORWARD_ENUM(_type, _name) _type _name
#define CR_FORWARD_ENUM(_type, _name) typedef _type _name
#endif
// Adapted from NSPathUtilities.h and NSObjCRuntime.h.
#if __LP64__ || NS_BUILD_32_LIKE_64
typedef CR_FORWARD_ENUM(unsigned long, NSSearchPathDirectory);
CR_FORWARD_ENUM(unsigned long, NSSearchPathDirectory);
typedef unsigned long NSSearchPathDomainMask;
#else
typedef CR_FORWARD_ENUM(unsigned int, NSSearchPathDirectory);
CR_FORWARD_ENUM(unsigned int, NSSearchPathDirectory);
typedef unsigned int NSSearchPathDomainMask;
#endif
......
......@@ -315,6 +315,10 @@ struct GenericStringRef {
GenericStringRef(const CharType* str, SizeType len)
: s(str), length(len) { RAPIDJSON_ASSERT(s != NULL); }
// Required by clang++ 11 on MacOS catalina
GenericStringRef(const GenericStringRef& other)
: s(other.s), length(other.length) { RAPIDJSON_ASSERT(s != NULL); }
//! implicit conversion to plain CharType pointer
operator const Ch *() const { return s; }
......@@ -322,11 +326,11 @@ struct GenericStringRef {
const SizeType length; //!< length of the string (excluding the trailing NULL terminator)
private:
//! Disallow copy-assignment
GenericStringRef operator=(const GenericStringRef&);
//! Disallow copy-ctor&assignment
GenericStringRef operator=(const GenericStringRef&) = delete;
//! Disallow construction from non-const array
template<SizeType N>
GenericStringRef(CharType (&str)[N]) /* = delete */;
GenericStringRef(CharType (&str)[N]) = delete;
};
//! Mark a character pointer as constant string
......
......@@ -71,6 +71,9 @@ class BUTIL_EXPORT TimeDelta {
TimeDelta() : delta_(0) {
}
// Required by clang++ 11 on MacOS catalina
TimeDelta(const TimeDelta& other) : delta_(other.delta_) {}
// Converts units of time to TimeDeltas.
static TimeDelta FromDays(int days);
static TimeDelta FromHours(int hours);
......@@ -269,6 +272,9 @@ class BUTIL_EXPORT Time {
Time() : us_(0) {
}
// Required by clang++ 11 on MacOS catalina
Time(const Time& other) : us_(other.us_) {}
// Returns true if the time object has not been initialized.
bool is_null() const {
return us_ == 0;
......@@ -608,6 +614,9 @@ class BUTIL_EXPORT TimeTicks {
TimeTicks() : ticks_(0) {
}
// Required by clang++ 11 on MacOS catalina
TimeTicks(const TimeTicks& other) : ticks_(other.ticks_) {}
// Platform-dependent tick count representing "right now."
// The resolution of this clock is ~1-15ms. Resolution varies depending
// on hardware/operating system configuration.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment