Per, I have a vague memory that when I checked the most previous time, when in module A I declared a particular C type, and in module B I had a C FFI definition that made use of that type (for argument or return value), I needed to redefine the C type in module B.
How is it nowadays?
Are there any risks involved in this, such as that the one and same C type, as created by FFI routines in module A and B, could somehow appear as made of two different types, or that they would somehow be incompatible with each others?
Mikael
Afficher les réponses par date
C types declarations are not exported. I don't think there are any risks involved as the types in C should be the same and the only other information that gambit keeps is a tag.
It should be possible to make something to do what you want but as there is no information available (Or readily available) about c-types in the compilation environment, you'll need to use a macro to define your c-types and register that information before calling the special forms.
I did a small straightforward library for that but it is far from complete. It defines a macro c-define-type* that will register the expansion of the type in a table at compile time and fonctions to get the c equivalent of a gambit type. Like I said, nothing fancy but you will probably need to write it and time is precious...
BH does not support exporting c-define-type things as of now. It should be relatively simple to implement though.
/Per
30 apr 2009 kl. 14.04 skrev Mikael More:
Per,
I have a vague memory that when I checked the most previous time, when in module A I declared a particular C type, and in module B I had a C FFI definition that made use of that type (for argument or return value), I needed to redefine the C type in module B.
How is it nowadays?
Are there any risks involved in this, such as that the one and same C type, as created by FFI routines in module A and B, could somehow appear as made of two different types, or that they would somehow be incompatible with each others?
Mikael
Gambit-modules-list mailing list Gambit-modules-list@mercure.iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-modules-list
gambit-modules-list@iro.umontreal.ca