util: Remove EXPLICIT_CONVERSION macro and use c++11 explicit directly
authorYonggang Luo <luoyonggang@gmail.com>
Mon, 21 Nov 2022 11:01:50 +0000 (19:01 +0800)
committerYonggang Luo <luoyonggang@gmail.com>
Tue, 22 Nov 2022 07:42:15 +0000 (15:42 +0800)
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>

src/util/bitset.h
src/util/macros.h

index e1e5962..9765345 100644 (file)
@@ -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++)         \
index f3870d2..cb6b5a7 100644 (file)
@@ -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 */