Skip to content

Commit

Permalink
Remove dependency on stdio.h and inttypes.h
Browse files Browse the repository at this point in the history
Exclude header dependencies from C and C++ header generators when PAL is not
configured to print using the printf_utf8 print mechanism

Signed-off-by: JaredWright <[email protected]>
  • Loading branch information
JaredWright committed Apr 23, 2020
1 parent 4b21412 commit d5a6d31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions pal/generator/c_header_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@ def generate(self, regs, outpath):
include_guard = "PAL_" + reg.name.upper() + "_H"
self.gadgets["pal.include_guard"].name = include_guard
self.gadgets["pal.header_depends"].includes = [
"<stdint.h>",
"<stdio.h>",
"<inttypes.h>"
"<stdint.h>"
]

if config.print_mechanism == "printf_utf8":
self.gadgets["pal.header_depends"].includes.extend([
"<stdio.h>",
"<inttypes.h>"
])

outfile_path = os.path.join(outpath, reg.name.lower() + ".h")
outfile_path = os.path.abspath(outfile_path)

Expand Down
10 changes: 7 additions & 3 deletions pal/generator/cxx_header_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ def generate(self, regs, outpath):
include_guard = "PAL_" + reg.name.upper() + "_H"
self.gadgets["pal.include_guard"].name = include_guard
self.gadgets["pal.header_depends"].includes = [
"<stdint.h>",
"<stdio.h>",
"<inttypes.h>"
"<stdint.h>"
]

if config.print_mechanism == "printf_utf8":
self.gadgets["pal.header_depends"].includes.extend([
"<stdio.h>",
"<inttypes.h>"
])

outfile_path = os.path.join(outpath, reg.name.lower() + ".h")
outfile_path = os.path.abspath(outfile_path)

Expand Down

0 comments on commit d5a6d31

Please sign in to comment.