JuliaInterop / Cxx.jl

The Julia C++ Interface
Other
760 stars 107 forks source link

Cannot return unsigned long on 32-bit machine #370

Open steenpass opened 6 years ago

steenpass commented 6 years ago

The following works on 64-bit, but not on 32-bit:

julia> using Cxx

julia> icxx"""0UL;"""
Invalid bitcast
  %0 = bitcast i32 %call to i64

define i64 @cxxjl.20() personality i32 ()* @__cxxjl_personality_v0 {
top:
  %call = call i32 @_ZN6__icxx6icxx20Ev()
  %0 = bitcast i32 %call to i64
  ret i64 %0
}

ERROR: error compiling cxxstr_impl: Malformed LLVM Function

julia> 
ScottPJones commented 6 years ago

A long is typically 32 bits on 32-bit C/C++ platforms.