Update uuid C++ implementation
This commit is contained in:
@@ -20,13 +20,14 @@ struct WUUID {
|
|||||||
Str8 uuid;
|
Str8 uuid;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define wapp_uuid_gen_uuid4() *(wapp_uuid_init_uuid4(&wapp_uuid_create()))
|
|
||||||
|
|
||||||
/* Low level UUID API */
|
|
||||||
|
|
||||||
#ifdef WAPP_PLATFORM_CPP
|
#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)})
|
#define wapp_uuid_create() (WUUID{wapp_str8_buf(UUID_BUF_LENGTH)})
|
||||||
#else
|
#else
|
||||||
|
#define wapp_uuid_gen_uuid4() *(wapp_uuid_init_uuid4(&wapp_uuid_create()))
|
||||||
#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
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user