aboutsummaryrefslogtreecommitdiff
path: root/Src/replicant/foundation/guid.h
diff options
context:
space:
mode:
authorJean-Francois Mauguit <jfmauguit@mac.com>2024-09-24 09:03:25 -0400
committerGitHub <noreply@github.com>2024-09-24 09:03:25 -0400
commitbab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/replicant/foundation/guid.h
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/replicant/foundation/guid.h')
-rw-r--r--Src/replicant/foundation/guid.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/Src/replicant/foundation/guid.h b/Src/replicant/foundation/guid.h
new file mode 100644
index 00000000..7e638c7d
--- /dev/null
+++ b/Src/replicant/foundation/guid.h
@@ -0,0 +1,35 @@
+#ifndef WASABI2_FOUNDATION_GUID_H
+#define WASABI2_FOUNDATION_GUID_H
+#pragma once
+
+#include "types.h"
+
+#if !defined(_WIN32)
+#ifdef __cplusplus
+#if !defined(GUID_EQUALS_DEFINED) || !defined(_SYS_GUID_OPERATOR_EQ_)
+#define GUID_EQUALS_DEFINED
+#include <memory.h>
+#include <string.h>
+static __inline int operator ==(const GUID &a, const GUID &b) {
+ return !memcmp(&a, &b, sizeof(GUID));
+}
+static __inline int operator !=(const GUID &a, const GUID &b) {
+ return !!memcmp(&a, &b, sizeof(GUID));
+}
+#endif //GUID_EQUALS_DEFINED
+#endif //__cplusplus
+#else
+#include <guiddef.h>
+#endif
+
+#ifdef __cplusplus
+static __inline int operator <(const GUID &a, const GUID &b) {
+ return memcmp(&a, &b, sizeof(GUID)) < 0;
+}
+#endif
+
+
+static const GUID INVALID_GUID = { 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0} };
+static const GUID GENERIC_GUID = { 0xFFFFFFFF, 0xFFFF, 0xFFFF, {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} };
+
+#endif