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.
17 lines
404 B
Python
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")
|
|
|