Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Macros
SkMacros.h File Reference

Go to the source code of this file.

Macros

#define SK_MACRO_CONCAT(X, Y)   SK_MACRO_CONCAT_IMPL_PRIV(X, Y)
 
#define SK_MACRO_CONCAT_IMPL_PRIV(X, Y)   X ## Y
 
#define SK_MACRO_APPEND_LINE(name)   SK_MACRO_CONCAT(name, __LINE__)
 
#define SK_MACRO_APPEND_COUNTER(name)   SK_MACRO_CONCAT(name, __COUNTER__)
 
#define SK_BEGIN_REQUIRE_DENSE
 
#define SK_END_REQUIRE_DENSE
 
#define SK_INTENTIONALLY_LEAKED(X)   ((void)0)
 
#define SK_INIT_TO_AVOID_WARNING   = 0
 
#define SK_MAKE_BITFIELD_OPS(X)
 
#define SK_DECL_BITFIELD_OPS_FRIENDS(X)
 

Macro Definition Documentation

◆ SK_BEGIN_REQUIRE_DENSE

#define SK_BEGIN_REQUIRE_DENSE

Definition at line 37 of file SkMacros.h.

◆ SK_DECL_BITFIELD_OPS_FRIENDS

#define SK_DECL_BITFIELD_OPS_FRIENDS (   X)
Value:
friend X operator ~(X a); \
friend X operator |(X a, X b); \
friend X& operator |=(X& a, X b); \
\
friend X operator &(X a, X b); \
friend X& operator &=(X& a, X b);
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E > constexpr operator&(E l, E r)
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E & > constexpr operator&=(E &l, E r)
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E > constexpr operator~(E e)
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E > constexpr operator|(E l, E r)
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E & > constexpr operator|=(E &l, E r)
static const SkScalar X
static bool b
struct MyStruct a[10]

Definition at line 86 of file SkMacros.h.

◆ SK_END_REQUIRE_DENSE

#define SK_END_REQUIRE_DENSE

Definition at line 38 of file SkMacros.h.

◆ SK_INIT_TO_AVOID_WARNING

#define SK_INIT_TO_AVOID_WARNING   = 0

Definition at line 58 of file SkMacros.h.

◆ SK_INTENTIONALLY_LEAKED

#define SK_INTENTIONALLY_LEAKED (   X)    ((void)0)

Definition at line 55 of file SkMacros.h.

◆ SK_MACRO_APPEND_COUNTER

#define SK_MACRO_APPEND_COUNTER (   name)    SK_MACRO_CONCAT(name, __COUNTER__)

Definition at line 27 of file SkMacros.h.

◆ SK_MACRO_APPEND_LINE

#define SK_MACRO_APPEND_LINE (   name)    SK_MACRO_CONCAT(name, __LINE__)

Definition at line 25 of file SkMacros.h.

◆ SK_MACRO_CONCAT

#define SK_MACRO_CONCAT (   X,
  Y 
)    SK_MACRO_CONCAT_IMPL_PRIV(X, Y)

Definition at line 16 of file SkMacros.h.

◆ SK_MACRO_CONCAT_IMPL_PRIV

#define SK_MACRO_CONCAT_IMPL_PRIV (   X,
  Y 
)    X ## Y

Definition at line 17 of file SkMacros.h.

◆ SK_MAKE_BITFIELD_OPS

#define SK_MAKE_BITFIELD_OPS (   X)
Value:
inline X operator ~(X a) { \
using U = std::underlying_type_t<X>; \
return (X) (~static_cast<U>(a)); \
} \
inline X operator |(X a, X b) { \
using U = std::underlying_type_t<X>; \
return (X) (static_cast<U>(a) | static_cast<U>(b)); \
} \
inline X& operator |=(X& a, X b) { \
return (a = a | b); \
} \
inline X operator &(X a, X b) { \
using U = std::underlying_type_t<X>; \
return (X) (static_cast<U>(a) & static_cast<U>(b)); \
} \
inline X& operator &=(X& a, X b) { \
return (a = a & b); \
}

Defines overloaded bitwise operators to make it easier to use an enum as a bitfield.

Definition at line 66 of file SkMacros.h.

67 { \
68 using U = std::underlying_type_t<X>; \
69 return (X) (~static_cast<U>(a)); \
70 } \
71 inline X operator |(X a, X b) { \
72 using U = std::underlying_type_t<X>; \
73 return (X) (static_cast<U>(a) | static_cast<U>(b)); \
74 } \
75 inline X& operator |=(X& a, X b) { \
76 return (a = a | b); \
77 } \
78 inline X operator &(X a, X b) { \
79 using U = std::underlying_type_t<X>; \
80 return (X) (static_cast<U>(a) & static_cast<U>(b)); \
81 } \
82 inline X& operator &=(X& a, X b) { \
83 return (a = a & b); \
84 }