mirror of
https://github.com/justinian/jsix.git
synced 2025-12-09 16:04:32 -08:00
[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.
This commit is contained in:
16
scripts/codegen/__init__.py
Normal file
16
scripts/codegen/__init__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user