brenhinkeller / StaticTools.jl

Enabling StaticCompiler.jl-based compilation of (some) Julia code to standalone native binaries by avoiding GC allocations and llvmcall-ing all the things!
MIT License
167 stars 11 forks source link

Update `stdoutp()`, `stderrp()`, and `stdinp()` for Windows #58

Closed daizutabi closed 1 month ago

daizutabi commented 1 month ago

On Windows, stdoutp(), stderrp(), and stdinp() don't work:

julia> @assert Sys.iswindows()
julia> using StaticTools
julia> stdoutp()  # stderrp(), stdinp()
JIT session error: Symbols not found: [ stdout ]
...

After this PR:

julia> stdoutp()
Ptr{StaticTools.FILE} @0x00007ffa2bb8f4f8
julia> stderrp()
Ptr{StaticTools.FILE} @0x00007ffa2bb8f550
julia> stdinp()
Ptr{StaticTools.FILE} @0x00007ffa2bb8f4a0
mkitti commented 1 month ago

I assume this is meant to only address 64-bit Windows based on the assertions.

brenhinkeller commented 1 month ago

I’m fine with calling 32 bit windows “not planned” unless someone else wants to PR it