Change UUID to WUUID

Windows defines a UUID struct that causes clashes
This commit is contained in:
2025-12-15 15:13:56 +00:00
parent 6b7421c25d
commit 50b6a0b0f7
2 changed files with 12 additions and 12 deletions

View File

@@ -16,9 +16,9 @@ struct uuid4 {
};
wapp_intern UUID4 generate_uuid4(void);
wapp_intern void uuid4_to_uuid(const UUID4* uuid4, UUID *uuid);
wapp_intern void uuid4_to_uuid(const UUID4* uuid4, WUUID *uuid);
UUID *wapp_uuid_init_uuid4(UUID *uuid) {
WUUID *wapp_uuid_init_uuid4(WUUID *uuid) {
wapp_debug_assert(uuid != NULL, "`uuid` should not be NULL");
UUID4 uuid4 = generate_uuid4();
@@ -47,12 +47,12 @@ wapp_intern UUID4 generate_uuid4(void) {
return uuid;
}
wapp_intern void uuid4_to_uuid(const UUID4* uuid4, UUID *uuid) {
u64 grp1 = uuid4->high >> 32;
u64 grp2 = (uuid4->high << 32) >> 48;
u64 grp3 = (uuid4->high << 48) >> 48;
u64 grp4 = uuid4->low >> 48;
u64 grp5 = (uuid4->low << 16) >> 16;
wapp_intern void uuid4_to_uuid(const UUID4* uuid4, WUUID *uuid) {
u64 group1 = uuid4->high >> 32;
u64 group2 = (uuid4->high << 32) >> 48;
u64 group3 = (uuid4->high << 48) >> 48;
u64 group4 = uuid4->low >> 48;
u64 group5 = (uuid4->low << 16) >> 16;
wapp_str8_format(&(uuid->uuid), UUID_STR_FORMAT, grp1, grp2, grp3, grp4, grp5);
wapp_str8_format(&(uuid->uuid), UUID_STR_FORMAT, group1, group2, group3, group4, group5);
}