Add aliases.h and platform.h by default in codegen

This commit is contained in:
2025-04-20 20:10:10 +01:00
parent 9e34b37d8d
commit 0d541f6ee8
4 changed files with 22 additions and 27 deletions

View File

@@ -2,7 +2,7 @@ from pathlib import Path
from dataclasses import dataclass, field
from typing import List, Dict
from codegen.constants import WAPP_SRC_ROOT
from codegen.utils import load_func_body_from_file, convert_to_relative
from codegen.utils import load_func_body_from_file
from codegen.datatypes import (
CDataType,
CMacro,
@@ -48,19 +48,9 @@ def make_dbl_list(user_datatypes: Dict[CDataType, DblListData] = {}):
out_dir = WAPP_SRC_ROOT / "containers" / "dbl_list"
out_dir.mkdir(parents=True, exist_ok=True)
common_local_include_files = [
(WAPP_SRC_ROOT / "common" / "aliases" / "aliases.h")
]
common_includes: List[CInclude] = [
CInclude(header="stdbool.h")
]
for local_file in common_local_include_files:
common_includes.append(
CInclude(
header=str(convert_to_relative(local_file, out_dir)).replace("\\", "/"),
local=True,
)
)
common_decl_types: List[CStruct] = []
@@ -101,15 +91,7 @@ def make_dbl_list(user_datatypes: Dict[CDataType, DblListData] = {}):
header = CHeader(
name="dbl_list",
decl_types=[*common_decl_types],
includes=[
CInclude(
header=str(convert_to_relative(
WAPP_SRC_ROOT / "common" / "platform" / "platform.h",
out_dir
)).replace("\\", "/"),
local=True,
)
],
includes=[],
types=[],
funcs=[]
)