From 68338121c73d9741cf038de9a828836e7dc29392 Mon Sep 17 00:00:00 2001 From: judah Date: Wed, 23 Jul 2025 18:26:52 -0600 Subject: [PATCH] context cracking --- module.jai | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/module.jai b/module.jai index eb9858c..44763e2 100644 --- a/module.jai +++ b/module.jai @@ -1,9 +1,8 @@ +#module_parameters(IMPORT_LOCATION := #caller_location); + #scope_export; -byte :: u8; -f32 :: float32; -f64 :: float64; - +byte :: u8; 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); +}