diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 87b81c3..6fedf56 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -84,7 +84,7 @@ jobs: - run: | mk python-release owner=libre-embedded \ - repo=ifgen version=4.6.0 + repo=ifgen version=4.6.1 if: | matrix.python-version == '3.13' && matrix.system == 'ubuntu-latest' diff --git a/README.md b/README.md index 0f0cab5..61bd42f 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ ===================================== generator=datazen version=3.2.3 - hash=8d3c526a8528a19206c3cbb830964859 + hash=b1734afc9a17480fd92d42eb65e351f9 ===================================== --> -# ifgen ([4.6.0](https://pypi.org/project/ifgen/)) +# ifgen ([4.6.1](https://pypi.org/project/ifgen/)) [![python](https://img.shields.io/pypi/pyversions/ifgen.svg)](https://pypi.org/project/ifgen/) ![Build Status](https://github.com/libre-embedded/ifgen/workflows/Python%20Package/badge.svg) diff --git a/config b/config index 6f91c48..2549d1a 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 6f91c48419d283105f397af4d718d7afb27937ba +Subproject commit 2549d1a7a11cbf4ac73dbfc66307c4a920531832 diff --git a/ifgen/__init__.py b/ifgen/__init__.py index c60bbfb..87390a7 100644 --- a/ifgen/__init__.py +++ b/ifgen/__init__.py @@ -1,7 +1,7 @@ # ===================================== # generator=datazen # version=3.2.3 -# hash=1d9a445cd0a6b0e0126151d1aa677943 +# hash=940874292201d38dfaaf344ff5181488 # ===================================== """ @@ -10,4 +10,4 @@ DESCRIPTION = "An interface generator for distributed computing." PKG_NAME = "ifgen" -VERSION = "4.6.0" +VERSION = "4.6.1" diff --git a/ifgen/config/__init__.py b/ifgen/config/__init__.py index fb72410..7952ae0 100644 --- a/ifgen/config/__init__.py +++ b/ifgen/config/__init__.py @@ -44,6 +44,7 @@ def init(self, data: _JsonObject) -> None: "stream", "methods", "default_endianness", + "packed", ] struct: dict[str, Any] for struct in data.get("structs", {}).values(): # type: ignore diff --git a/ifgen/data/schemas/Config.yaml b/ifgen/data/schemas/Config.yaml index e64938c..ea6e839 100644 --- a/ifgen/data/schemas/Config.yaml +++ b/ifgen/data/schemas/Config.yaml @@ -79,6 +79,9 @@ properties: unit_test: type: boolean default: true + packed: + type: boolean + default: true # https://en.cppreference.com/w/cpp/types/endian default_endianness: diff --git a/ifgen/data/schemas/Struct.yaml b/ifgen/data/schemas/Struct.yaml index 9e3e6c4..e843bf1 100644 --- a/ifgen/data/schemas/Struct.yaml +++ b/ifgen/data/schemas/Struct.yaml @@ -19,6 +19,8 @@ properties: type: boolean unit_test: type: boolean + packed: + type: boolean default_endianness: type: string enum: [little, big, native] diff --git a/ifgen/struct/header.py b/ifgen/struct/header.py index f7035ef..c4a315e 100644 --- a/ifgen/struct/header.py +++ b/ifgen/struct/header.py @@ -164,8 +164,10 @@ def struct_instance( def cpp_struct_header(task: GenerateTask, writer: IndentedFileWriter) -> None: """Create the contents of a C++ struct header file.""" - attributes = ["gnu::packed"] - writer.write(f"struct [[{', '.join(attributes)}]] {task.name}") + attributes = ["gnu::packed"] if task.instance["packed"] else None + attribute_str = f"[[{', '.join(attributes)}]]" if attributes else "" + writer.write(f"struct {attribute_str} {task.name}") + with writer.scope(suffix=";"): writer.c_comment("Constant attributes.") with writer.trailing_comment_lines( diff --git a/ifgen/svd/task.py b/ifgen/svd/task.py index fc13bec..8ee880b 100644 --- a/ifgen/svd/task.py +++ b/ifgen/svd/task.py @@ -110,6 +110,7 @@ def generate_configs(self, path: Path, config: SvdConfig) -> None: "codec": False, "methods": False, "unit_test": False, + "packed": False, }, "enum": {"use_map": False, "identifier": False}, }, diff --git a/local/variables/package.yaml b/local/variables/package.yaml index 579572f..de89c0f 100644 --- a/local/variables/package.yaml +++ b/local/variables/package.yaml @@ -1,5 +1,5 @@ --- major: 4 minor: 6 -patch: 0 +patch: 1 entry: ig diff --git a/pyproject.toml b/pyproject.toml index 5687a28..4389113 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__" [project] name = "ifgen" -version = "4.6.0" +version = "4.6.1" description = "An interface generator for distributed computing." readme = "README.md" requires-python = ">=3.12"