About Social Code
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYonggang Luo <luoyonggang@gmail.com>2022-11-21 19:01:50 +0800
committerYonggang Luo <luoyonggang@gmail.com>2022-11-22 15:42:15 +0800
commitaf50f6a490db594c7c026082dbe85ea5ddf81fb8 (patch)
tree07cb533edc17024c940ea7f1545acafcbe860f38
parent8c3268611604d0c7242f9e4b64796f4d4d895fbd (diff)
util: Remove EXPLICIT_CONVERSION macro and use c++11 explicit directly
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: David Heidelberg <david.heidelberg@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19895>
-rw-r--r--src/util/bitset.h2
-rw-r--r--src/util/macros.h10
2 files changed, 1 insertions, 11 deletions
diff --git a/src/util/bitset.h b/src/util/bitset.h
index e1e5962e59f..9765345dc1d 100644
--- a/src/util/bitset.h
+++ b/src/util/bitset.h
@@ -446,7 +446,7 @@ __bitset_next_range(unsigned *start, unsigned *end, const BITSET_WORD *set,
* it as, and N is the number of bits in the bitset.
*/
#define DECLARE_BITSET_T(T, N) struct T { \
- EXPLICIT_CONVERSION \
+ explicit \
operator bool() const \
{ \
for (unsigned i = 0; i < BITSET_WORDS(N); i++) \
diff --git a/src/util/macros.h b/src/util/macros.h
index f3870d23b54..cb6b5a753a2 100644
--- a/src/util/macros.h
+++ b/src/util/macros.h
@@ -355,16 +355,6 @@ do { \
/** Checks is a value is a power of two. Does not handle zero. */
#define IS_POT(v) (((v) & ((v) - 1)) == 0)
-/**
- * Macro for declaring an explicit conversion operator. Defaults to an
- * implicit conversion if C++11 is not supported.
- */
-#if __cplusplus >= 201103L
-#define EXPLICIT_CONVERSION explicit
-#elif defined(__cplusplus)
-#define EXPLICIT_CONVERSION
-#endif
-
/** Set a single bit */
#define BITFIELD_BIT(b) (1u << (b))
/** Set all bits up to excluding bit b */