Files
jsix/scripts/codegen/__init__.py
Justin C. Miller fca570a163 [scripts] Make j6libc.py into the codegen package
j6libc.py was initially made for libc to generate stdint.h, but it
gained a few things that aren't libc-specific. Move it to a package and
split the int-types-specific code into codegen.int_types.
2024-08-10 23:29:21 -07:00

17 lines
404 B
Python

import cog
supported_architectures = {
"amd64": "__amd64__",
}
def arch_includes(header, root=""):
prefix = "if"
for arch, define in supported_architectures.items():
cog.outl(f"#{prefix} defined({define})")
cog.outl(f"#include <{root}arch/{arch}/{header}>")
prefix = "elif"
cog.outl("#else")
cog.outl('#error "Unsupported platform"')
cog.outl("#endif")