This is an automated email from the ASF dual-hosted git repository.
jamesge pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git
The following commit(s) were added to refs/heads/master by this push:
new a78a34e fix errors with clang++ 11 on MacOS Catalina
a78a34e is described below
commit a78a34eaf044b6510156dfa17316ee8fe4138b7f
Author: jamesge <[email protected]>
AuthorDate: Sat Nov 21 19:17:11 2020 +0800
fix errors with clang++ 11 on MacOS Catalina
---
src/butil/mac/foundation_util.h | 8 ++++----
src/butil/third_party/rapidjson/document.h | 10 +++++++---
src/butil/time/time.h | 9 +++++++++
3 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/src/butil/mac/foundation_util.h b/src/butil/mac/foundation_util.h
index 8e00438..12b8e66 100644
--- a/src/butil/mac/foundation_util.h
+++ b/src/butil/mac/foundation_util.h
@@ -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
diff --git a/src/butil/third_party/rapidjson/document.h
b/src/butil/third_party/rapidjson/document.h
index f802110..a706586 100644
--- a/src/butil/third_party/rapidjson/document.h
+++ b/src/butil/third_party/rapidjson/document.h
@@ -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
diff --git a/src/butil/time/time.h b/src/butil/time/time.h
index c33dfcc..cdc57b6 100644
--- a/src/butil/time/time.h
+++ b/src/butil/time/time.h
@@ -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.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]