Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c727950d8 | |||
| c7c4f88866 |
@@ -22,12 +22,19 @@ struct WUUID {
|
|||||||
|
|
||||||
// TODO (Abdelrahman): Update UUID implementation to work properly with C++ and tests for validation
|
// TODO (Abdelrahman): Update UUID implementation to work properly with C++ and tests for validation
|
||||||
|
|
||||||
|
#ifdef WAPP_PLATFORM_CPP
|
||||||
|
#define wapp_uuid_gen_uuid4() ([&](){ \
|
||||||
|
wapp_persist WUUID uuid = wapp_uuid_create(); \
|
||||||
|
return *(wapp_uuid_init_uuid4(&uuid)) \
|
||||||
|
}())
|
||||||
|
#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()))
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Low level UUID API */
|
/* Low level UUID API */
|
||||||
|
|
||||||
#ifdef WAPP_PLATFORM_CPP
|
#ifdef WAPP_PLATFORM_CPP
|
||||||
#define wapp_uuid_create() ([&](){ return WUUID{wapp_str8_buf(UUID_BUF_LENGTH)}; })
|
#define wapp_uuid_create() ([&](){ return WUUID{wapp_str8_buf(UUID_BUF_LENGTH)}; }())
|
||||||
#else
|
#else
|
||||||
#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