mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
22 lines
507 B
Python
22 lines
507 B
Python
import cog
|
|
|
|
supported_architectures = {
|
|
"amd64": "__amd64__",
|
|
}
|
|
|
|
def arch_includes(header, root=""):
|
|
from pathlib import Path
|
|
root = Path(root)
|
|
header = Path(header)
|
|
|
|
prefix = "if"
|
|
for arch, define in supported_architectures.items():
|
|
path = root / "arch" / arch / header
|
|
cog.outl(f"#{prefix} defined({define})")
|
|
cog.outl(f"#include <{path}>")
|
|
prefix = "elif"
|
|
cog.outl("#else")
|
|
cog.outl('#error "Unsupported platform"')
|
|
cog.outl("#endif")
|
|
|