MCPcopy Create free account
hub / github.com/crownengine/crown / new_guid

Function new_guid

src/core/guid.cpp:48–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46namespace guid
47{
48 Guid new_guid()
49 {
50 Guid guid;
51#if CROWN_PLATFORM_WINDOWS
52 HRESULT hr = CoCreateGuid((GUID *)&guid);
53 CE_ASSERT(hr == S_OK, "CoCreateGuid: error");
54 CE_UNUSED(hr);
55#else
56 CE_ASSERT(guid_globals::_fd != -1, "new_guid: library uninitialized");
57 ssize_t rb = read(guid_globals::_fd, &guid, sizeof(guid));
58 CE_ENSURE(rb == sizeof(guid));
59 CE_UNUSED(rb);
60 guid.data1 = (guid.data1 & 0xffffffffffff4fffu) | 0x4000u;
61 guid.data2 = (guid.data2 & 0x3fffffffffffffffu) | 0x8000000000000000u;
62#endif
63 return guid;
64 }
65
66 Guid parse(const char *str)
67 {

Callers 7

test_guidFunction · 0.85
test_filesystemFunction · 0.85
open_temporaryMethod · 0.85
temporary_pathMethod · 0.85
load_apiFunction · 0.85
LuaEnvironmentMethod · 0.85

Calls 1

readFunction · 0.50

Tested by 3

test_guidFunction · 0.68
test_filesystemFunction · 0.68