include: Add DEFINE_ENUM_FLAG_OPERATORS to winnt.h.
This commit is contained in:
parent
92223ac913
commit
912f040748
|
@ -309,6 +309,21 @@ extern "C" {
|
|||
#define ERROR_SEVERITY_WARNING 0x80000000
|
||||
#define ERROR_SEVERITY_ERROR 0xC0000000
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
|
||||
extern "C++" { \
|
||||
inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a)|((int)b)); } \
|
||||
inline ENUMTYPE operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) |= ((int)b)); } \
|
||||
inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a)&((int)b)); } \
|
||||
inline ENUMTYPE operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) &= ((int)b)); } \
|
||||
inline ENUMTYPE operator ~ (ENUMTYPE a) { return (ENUMTYPE)(~((int)a)); } \
|
||||
inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a)^((int)b)); } \
|
||||
inline ENUMTYPE operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) ^= ((int)b)); } \
|
||||
}
|
||||
#else
|
||||
#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) /* */
|
||||
#endif
|
||||
|
||||
/* Microsoft's macros for declaring functions */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Reference in New Issue