mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
include: Provide enum flag operators for D3D12_RESOURCE_FLAGS.
This commit is contained in:
@@ -209,4 +209,22 @@ typedef struct SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES;
|
||||
# define max(a, b) (((a) >= (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef DEFINE_ENUM_FLAG_OPERATORS
|
||||
#ifdef __cplusplus
|
||||
# define DEFINE_ENUM_FLAG_OPERATORS(type) \
|
||||
extern "C++" \
|
||||
{ \
|
||||
inline type operator &(type x, type y) { return (type)((int)x & (int)y); } \
|
||||
inline type operator &=(type &x, type y) { return (type &)((int &)x &= (int)y); } \
|
||||
inline type operator ~(type x) { return (type)~(int)x; } \
|
||||
inline type operator |(type x, type y) { return (type)((int)x | (int)y); } \
|
||||
inline type operator |=(type &x, type y) { return (type &)((int &)x |= (int)y); } \
|
||||
inline type operator ^(type x, type y) { return (type)((int)x ^ (int)y); } \
|
||||
inline type operator ^=(type &x, type y) { return (type &)((int &)x ^= (int)y); } \
|
||||
}
|
||||
#else
|
||||
# define DEFINE_ENUM_FLAG_OPERATORS(type)
|
||||
#endif
|
||||
#endif /* DEFINE_ENUM_FLAG_OPERATORS */
|
||||
|
||||
#endif /* __VKD3D_WINDOWS_H */
|
||||
|
Reference in New Issue
Block a user