guid.h 630 B

123456789101112131415161718192021222324
  1. #ifndef _GUID_H
  2. #define _GUID_H
  3. #include "types.h"
  4. #include "platform.h"
  5. #ifdef __cplusplus
  6. #ifndef GUID_EQUALS_DEFINED
  7. #define GUID_EQUALS_DEFINED
  8. #include <memory.h>
  9. static __inline int operator ==(const GUID &a, const GUID &b) {
  10. return !memcmp(&a, &b, sizeof(GUID));
  11. }
  12. static __inline int operator !=(const GUID &a, const GUID &b) {
  13. return !!memcmp(&a, &b, sizeof(GUID));
  14. }
  15. #endif //GUID_EQUALS_DEFINED
  16. #endif //__cplusplus
  17. static const GUID INVALID_GUID = { 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0} };
  18. static const GUID GENERIC_GUID = { 0xFFFFFFFF, 0xFFFF, 0xFFFF, {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} };
  19. #endif