Fix possible C2084 compiler error (#735)

* Fix possible C2084 compiler error

Guiddef.h uses a separate header guard to define the GUID operators, in the current codebase this won't cause any issue, but i got such error while fiddling a bit with the program and including something that ended up including all the various windows headers, that ended up including Guiddef.h, causing the error as by not finding the macro declared, it ended up declaring the inline operators as well.

* Update api.h
master
Edoardo Lolletti 2022-07-18 03:11:32 +02:00 committed by GitHub
parent c6064a2034
commit e28a49363e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -28,11 +28,14 @@ typedef struct _GUID {
std::uint8_t Data4[8];
} GUID;
#ifndef _SYS_GUID_OPERATOR_EQ_
#define _SYS_GUID_OPERATOR_EQ_
inline bool operator==(const GUID& lhs, const GUID& rhs) noexcept
{ return std::memcmp(&lhs, &rhs, sizeof(GUID)) == 0; }
inline bool operator!=(const GUID& lhs, const GUID& rhs) noexcept
{ return !(lhs == rhs); }
#endif // _SYS_GUID_OPERATOR_EQ_
#endif // GUID_DEFINED