[Ecls-list] FFI type mismatch for integer

Goffioul Michael goffioul at imec.be
Fri Jun 3 06:06:49 UTC 2005


> I got a problem while playing with FFI and integer types (I'm 
> actually trying
> to build a FFI interface for Win32 GUI API). The problem is 
> that conversion
> between C and LISP is not invertable:
> 
> 	C -> LISP : make_integer, which can produce bignums
> 	LISP -> C : object_to_fixnum, which can not handle 
> bignums (the ones produced
> 			by make_integer)
> 
> I think there should be a "object_to_integer"  function.
> 
> Another point is that FFI doesn't seem to conserve signness 
> of integers as "make_integer"
> is used whether you defined the object type as :int or :unsigned-int.

Looking more deeply, it appears that the problem I have is related to the signness
only. object_to_fixnum can handle bignums, but cmpffi.lsp should handle signed
and unsigned integers separately.

Michael.




More information about the ecl-devel mailing list