Reintroduce C++ support and add usage tests for C++ (#4)

Reviewed-on: #4
Co-authored-by: Abdelrahman <said.abdelrahman89@gmail.com>
Co-committed-by: Abdelrahman <said.abdelrahman89@gmail.com>
This commit was merged in pull request #4.
This commit is contained in:
2025-08-10 22:33:40 +00:00
committed by Abdelrahman Said
parent 011083ab83
commit d3fccd61b5
42 changed files with 2499 additions and 104 deletions

View File

@@ -28,6 +28,15 @@ RETURN_STR8:
return str;
}
Str8 *wapp_str8_alloc_and_fill_buf(const Allocator *allocator, u64 capacity) {
Str8 *out = wapp_str8_alloc_buf(allocator, capacity);
if (out) {
memset(out->buf, 0, capacity);
out->size = capacity;
}
return out;
}
Str8 *wapp_str8_alloc_cstr(const Allocator *allocator, const char *str) {
wapp_debug_assert(allocator != NULL && str != NULL, "`allocator` and `str` should not be NULL");