gec: Is it possible to specify a signature for a external C call?

Berend de Boer <[email protected]> Mon, 12 Nov 2007 12:34:31 +1300
Newsgroups gmane.comp.lang.eiffel.gobo.general
Message-ID <[email protected]>
Hi All,

Just trying to gec working with eposix, and stumbled upon a situation
that baffled me completely for a while.

I have this Eiffel function:

	posix_difftime (time_end, time_start: INTEGER): DOUBLE is
		external "C"
    end

The C function behind this has this signature:

  EIF_DOUBLE posix_difftime(EIF_INTEGER time1, EIF_INTEGER time0);


Gobo calls this fine, however, it does not create a signature for this
posix_difftime.

It seems C creates a default signature in this case, something like

  int posix_difftime(int time1, int time0);


As you can see, this function returns an int instead of a double. So all
my calls to C functions that return a double are completely wrong.


I think Gobo should create default signatures for external functions
just matching the Eiffel code signature. That would fix the problem.

I could also specify a signature myself, but how to do that? Does gec
already support that?

-- 
Cheers,

Berend de Boer


[Non-text portions of this message have been removed]