Compare commits
2 Commits
610df6869f
...
58dab46902
| Author | SHA1 | Date | |
|---|---|---|---|
| 58dab46902 | |||
| 269ee5d9ab |
@@ -20,16 +20,11 @@ struct WUUID {
|
|||||||
Str8 uuid;
|
Str8 uuid;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef WAPP_PLATFORM_CPP
|
|
||||||
#define wapp_uuid_gen_uuid4() ([&](){
|
|
||||||
wapp_persist WUUID id = wapp_uuid_create();
|
|
||||||
return *wapp_uuid_init_uuid4(&id);
|
|
||||||
}())
|
|
||||||
#define wapp_uuid_create() (WUUID{wapp_str8_buf(UUID_BUF_LENGTH)})
|
|
||||||
#else
|
|
||||||
#define wapp_uuid_gen_uuid4() *(wapp_uuid_init_uuid4(&wapp_uuid_create()))
|
#define wapp_uuid_gen_uuid4() *(wapp_uuid_init_uuid4(&wapp_uuid_create()))
|
||||||
|
|
||||||
|
/* Low level UUID API */
|
||||||
|
|
||||||
#define wapp_uuid_create() ((WUUID){.uuid = wapp_str8_buf(UUID_BUF_LENGTH)})
|
#define wapp_uuid_create() ((WUUID){.uuid = wapp_str8_buf(UUID_BUF_LENGTH)})
|
||||||
#endif
|
|
||||||
|
|
||||||
// Just returns the same pointer that was passed in with the UUID initialised.
|
// Just returns the same pointer that was passed in with the UUID initialised.
|
||||||
// Fails when passed a NULL pointer.
|
// Fails when passed a NULL pointer.
|
||||||
|
|||||||
Reference in New Issue
Block a user