mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-08-05 18:57:47 +00:00
c_wrapper_generator.py: Migrated block-strings to fstrings.
Signed-off-by: Minos Galanakis <[email protected]>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user