context cracking
This commit is contained in:
parent
5cbcc10444
commit
68338121c7
1 changed files with 37 additions and 4 deletions
39
module.jai
39
module.jai
|
|
@ -1,9 +1,8 @@
|
||||||
|
#module_parameters(IMPORT_LOCATION := #caller_location);
|
||||||
|
|
||||||
#scope_export;
|
#scope_export;
|
||||||
|
|
||||||
byte :: u8;
|
byte :: u8;
|
||||||
f32 :: float32;
|
|
||||||
f64 :: float64;
|
|
||||||
|
|
||||||
cstring :: *byte;
|
cstring :: *byte;
|
||||||
rawptr :: *void;
|
rawptr :: *void;
|
||||||
|
|
||||||
|
|
@ -24,3 +23,37 @@ else {
|
||||||
uptr :: u32;
|
uptr :: u32;
|
||||||
sptr :: s32;
|
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);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue