mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-06-06 05:25:18 +00:00
c_wrapper_generator: Refactored _write_epilogue()
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
This commit is contained in:
@@ -94,18 +94,18 @@ class Base:
|
||||
def _write_epilogue(self, out: typing_util.Writable, header: bool) -> None:
|
||||
"""Write the epilogue of a C file.
|
||||
"""
|
||||
epilogue = []
|
||||
if header:
|
||||
out.write("""
|
||||
#ifdef __cplusplus
|
||||
}}
|
||||
#endif
|
||||
|
||||
#endif /* {guard} */
|
||||
"""
|
||||
.format(guard=self.header_guard))
|
||||
out.write("""
|
||||
/* End of automatically generated file. */
|
||||
""")
|
||||
epilogue += ['',
|
||||
'#ifdef __cplusplus',
|
||||
'}',
|
||||
'#endif',
|
||||
'',
|
||||
'#endif /* {} */'.format(self.header_guard),
|
||||
'']
|
||||
epilogue.append('/* End of automatically generated file. */')
|
||||
epilogue.append('')
|
||||
out.write("\n".join(epilogue))
|
||||
|
||||
def _wrapper_function_name(self, original_name: str) -> str:
|
||||
"""The name of the wrapper function.
|
||||
|
||||
@@ -205,7 +205,7 @@ class PSAWrapper(c_wrapper_generator.Base):
|
||||
|
||||
def _write_epilogue(self, out: typing_util.Writable, header: bool) -> None:
|
||||
if self._CPP_GUARDS:
|
||||
out.write(dedent(self.__EPILOGUE__).format(self._CPP_GUARDS))
|
||||
out.write("\n#endif /* {} */\n".format(self._CPP_GUARDS))
|
||||
super()._write_epilogue(out, header)
|
||||
|
||||
class PSALoggingWrapper(PSAWrapper, c_wrapper_generator.Logging):
|
||||
|
||||
Reference in New Issue
Block a user