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:
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

@@ -139,7 +139,7 @@ def make_dbl_list(user_datatypes: Dict[CDataType, DblListData] = {}):
],
)
node_macro = CMacro(
node_cmacro = CMacro(
name=f"wapp_{type_string_lower}_list_node(ITEM_PTR)",
value=__format_func_body(
filename=snippets_dir / "list_node",
@@ -151,6 +151,18 @@ def make_dbl_list(user_datatypes: Dict[CDataType, DblListData] = {}):
),
)
node_cppmacro = CMacro(
name=f"wapp_{type_string_lower}_list_node(ITEM_PTR)",
value=__format_func_body(
filename=snippets_dir / "list_node_cpp",
type_string=type_string,
type_string_upper=type_string_upper,
type_string_lower=type_string_lower,
node_typename=dbl_list_data.node_typename,
list_typename=dbl_list_data.list_typename
),
)
get_func = CFunc(
name=f"wapp_{type_string_lower}_list_get",
ret_type=node,
@@ -307,7 +319,8 @@ def make_dbl_list(user_datatypes: Dict[CDataType, DblListData] = {}):
)
header.decl_types.extend(dbl_list_data.hdr_decl_types)
header.macros.append(node_macro)
header.c_macros.append(node_cmacro)
header.cpp_macros.append(node_cppmacro)
header.types.extend([node, dl_list])
header.funcs.extend([
get_func,