define_c_func/proc and 64-bit return types
- Posted by ghaberek (admin) Jul 29, 2012
- 1410 views
I'm trying to wrap a function that returns a int64_t value.
I know I can pass int64_t as a long long via two C_LONG values:
procedure some_routine( atom param ) atom hi_dword = and_bits( param / #100000000, #FFFFFFFF ) atom lo_dword = and_bits( param, #FFFFFFFF ) c_proc( xsome_routine, {lo_dword,hi_dword} ) end procedure
But how (or can) I do the reverse?
It would be nice if I could declare the function like this:
constant xsome_routine = define_c_func( somelib, "some_routine", {}, {C_LONG,C_LONG} )
And then get back {lo_dword,hi_dword} when I call the function.
Although I suppose the best declaration would simply be:
constant xsome_routine = define_c_func( somelib, "some_routine", {}, C_LONGLONG )
-Greg