diff --git a/scripts/mbedtls_framework/c_wrapper_generator.py b/scripts/mbedtls_framework/c_wrapper_generator.py index 4f7e5c8ff..8644137bc 100644 --- a/scripts/mbedtls_framework/c_wrapper_generator.py +++ b/scripts/mbedtls_framework/c_wrapper_generator.py @@ -67,25 +67,25 @@ class Base: This includes a description comment and some include directives. """ - prologue = textwrap.dedent(""" - /* Automatically generated by generate_psa_wrappers.py, do not edit! */ + prologue = textwrap.dedent(f''' + /* Automatically generated by {self.program_name}, do not edit! */ /* Copyright The Mbed TLS Contributors * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ - """).lstrip() + ''').lstrip() if header: - prologue += textwrap.dedent(""" - #ifndef {guard} - #define {guard} + prologue += textwrap.dedent(f''' + #ifndef {self.header_guard} + #define {self.header_guard} #ifdef __cplusplus extern "C" {{ #endif - """.format(guard=self.header_guard)).lstrip() + ''').lstrip() for include in self._INCLUDES: prologue += "#include {}\n".format(include) @@ -100,14 +100,14 @@ class Base: """Write the epilogue of a C file.""" epilogue = "" if header: - epilogue += textwrap.dedent(""" + epilogue += textwrap.dedent(f''' #ifdef __cplusplus }} #endif - #endif /* {guard} */ + #endif /* {self.header_guard} */ - """.format(guard=self.header_guard)).lstrip() + ''').lstrip() epilogue += ('/* End of automatically generated file. */\n') out.write(epilogue)