Re: define_c_func/proc and 64-bit return types
- Posted by ghaberek (admin) Jul 30, 2012
- 1293 views
jimcbrown said...
I'm not sure if you can with 4.0 .. but 4.1 actually has a C_LONGLONG type and has support for doing this builtin already.
Interesting... There is a C_DWORDLONG in std/dll.e, but it's set the same as C_DOUBLE which AFAIK returns a 64-bit floating point value. I just want a 64-bit int.
--** double 64-bits C_DOUBLE = #03000008, --** dwordlong 64-bits C_DWORDLONG = #03000008,
Another problem I've run into is a series of functions that take and/or return the following structure by value!
struct x { float a; float b; float c; float d; }
Now, I can pass four floats to the function quite easily, but I'm thinking this 128-bit return value may be a problem for Euphoria.
So at this point I may have two options:
- Modify the source of the library to return int64_t and this quad-float structure by reference, then provide my custom-built library instead of the original.
- Write a shim library in C that links to the original library, reads the troublesome values and returns a pointer to them.
-Greg