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 is contained in:
4
codegen/array/snippets/array_pop_macro_cpp
Normal file
4
codegen/array/snippets/array_pop_macro_cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
(ARRAY_PTR != NULL && (ARRAY_PTR)->count > 0 ? \
|
||||
*_{Tlower}_array_pop(ARRAY_PTR) : \
|
||||
{T}{{}} \
|
||||
)
|
9
codegen/array/snippets/stack_array_cpp
Normal file
9
codegen/array/snippets/stack_array_cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
([&]() {{ \
|
||||
persistent {T} buf[wapp_misc_utils_u64_round_up_pow2(wapp_misc_utils_va_args_count({T}, __VA_ARGS__) * 2)] = {{__VA_ARGS__}}; \
|
||||
return {ArrayType}{{ \
|
||||
buf, \
|
||||
wapp_misc_utils_va_args_count({T}, __VA_ARGS__), \
|
||||
wapp_misc_utils_u64_round_up_pow2(wapp_misc_utils_va_args_count({T}, __VA_ARGS__) * 2), \
|
||||
sizeof({T}) \
|
||||
}}; \
|
||||
}}())
|
4
codegen/array/snippets/stack_capacity_array_cpp
Normal file
4
codegen/array/snippets/stack_capacity_array_cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
([&]() {{ \
|
||||
persistent {T} buf[CAPACITY] = {{}}; \
|
||||
return {ArrayType}{{buf, 0, CAPACITY, sizeof({T})}}; \
|
||||
}}())
|
Reference in New Issue
Block a user