diff --git a/codegen/datatypes.py b/codegen/datatypes.py index 0ea0466..3569180 100644 --- a/codegen/datatypes.py +++ b/codegen/datatypes.py @@ -258,7 +258,7 @@ def get_datatype_string(_type: CDataType) -> str: def _get_includes_string(includes: list[CInclude]) -> str: output = "" - for include in includes: + for include in sorted(includes, key=lambda inc: inc.local, reverse=True): output += str(include) if len(output) > 0: output += "\n"