Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
928 B

  1. #pragma once
  2. /*-----------------------------------------------------------------------------
  3. This macro generates various bit operations (and, or, etc.) for an enum type.
  4. Copied from \\jayk1\g\vs\src\vsee\lib\TransactionalFileSystem
  5. -----------------------------------------------------------------------------*/
  6. #define ENUM_BIT_OPERATIONS(e) \
  7. inline e operator|(e x, e y) { return static_cast<e>(static_cast<INT>(x) | static_cast<INT>(y)); } \
  8. inline e operator&(e x, e y) { return static_cast<e>(static_cast<INT>(x) & static_cast<INT>(y)); } \
  9. inline void operator&=(e& x, INT y) { x = static_cast<e>(static_cast<INT>(x) & y); } \
  10. inline void operator&=(e& x, e y) { x &= static_cast<INT>(y); } \
  11. inline void operator|=(e& x, INT y) { x = static_cast<e>(static_cast<INT>(x) | y); } \
  12. inline void operator|=(e& x, e y) { x |= static_cast<INT>(y); } \
  13. /* maybe more in the future */