From c7c4f888664bb8f5411a36aa0b2b7d14d9b89532 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 10 May 2026 02:19:34 +0100 Subject: [PATCH] Fix wapp_uuid_gen_uuid4 for C++ --- VERSION | 2 +- src/uuid/uuid.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7dea76e..6d7de6e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.1 +1.0.2 diff --git a/src/uuid/uuid.h b/src/uuid/uuid.h index 82b05e4..0afeea1 100644 --- a/src/uuid/uuid.h +++ b/src/uuid/uuid.h @@ -22,7 +22,14 @@ struct WUUID { // 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())) +#endif /* Low level UUID API */