mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
include: Provide enum flag operators for D3D12_RESOURCE_FLAGS.
This commit is contained in:
parent
7bdc8c3b25
commit
7a203b0e5f
@ -329,6 +329,7 @@ typedef enum D3D12_RESOURCE_FLAGS
|
||||
D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER = 0x10,
|
||||
D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS = 0x20,
|
||||
} D3D12_RESOURCE_FLAGS;
|
||||
cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(D3D12_RESOURCE_FLAGS);")
|
||||
|
||||
typedef struct D3D12_RESOURCE_DESC
|
||||
{
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user