context cracking

This commit is contained in:
Judah Caruso 2025-07-23 18:26:52 -06:00
parent 5cbcc10444
commit 68338121c7

View file

@ -1,9 +1,8 @@
#module_parameters(IMPORT_LOCATION := #caller_location);
#scope_export;
byte :: u8;
f32 :: float32;
f64 :: float64;
cstring :: *byte;
rawptr :: *void;
@ -24,3 +23,37 @@ else {
uptr :: u32;
sptr :: s32;
}
#if OS == {
case .WINDOWS;
#if CPU != .X64 #run report_error_on_import("JC is only supported x86-64 Windows systems, not %", CPU);
ARCH :: "x86-64";
PLATFORM :: "windows";
case .MACOS;
#if CPU == {
case .X64; ARCH :: "x86-64";
case .ARM64; ARCH :: "arm64";
}
PLATFORM :: "macos";
case .LINUX;
#if CPU != .X64 #run report_error_on_import("JC is only supported x86-64 Unix systems, not %", CPU);
ARCH :: "x86-64";
PLATFORM :: "unix";
case;
#run report_error_on_import("JC is not supported on % % systems", CPU, OS);
}
#scope_file;
report_error_on_import :: (fmt: string, args: ..Any) #compile_time {
basic :: #import "Basic"; // @future
compiler :: #import "Compiler"; // @future
compiler.compiler_report(basic.tprint(fmt, ..args), loc = IMPORT_LOCATION);
}