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

Berend de Boer <[email protected]> Mon, 12 Nov 2007 21:15:57 +1300
Newsgroups gmane.comp.lang.eiffel.gobo.general
Message-ID <[email protected]>
>>>>> "Eric" == Eric Bezault <ericb-D6Qt/9opevxWk0Htik3J/[email protected]> writes:

    Eric> When you wrote 'posix_difftime', you should have written a
    Eric> prototype for it in some header file as well. So what you have
    Eric> to do is:

    Eric>      posix_difftime (time_end, time_start: INTEGER): DOUBLE is
    Eric> external "C use %"some_header_file.h%"" end

    Eric> where 'some_header_file.h' is your header file.

That hasn't been necessary for any other Eiffel compiler so far.

So I think more people might run into this issue.

And for a wrapper library like POSIX that is kinda hard. The header file
might depend on the platform. So that means creating another header
which will include ge_eiffel.h, because I work with Eiffel types such as
EIF_INTEGER as parameter.

But that will redefine EIF_INTEGER and probably lots of other types
which are included in the generated .h file. Which leads to clashes I'm
afraid.

So I think creating a prototype in the .h is the best approach, and I
refer to SmartEiffel and ISE Eiffel which do this.

I could work a bit on this if you are convinced that this is the
approach that makes integration with C libraries as easy as possible. It
is, because you can link to any c (or Pascal/Fortran/whatever lib
without having to write a .h file).

You think this is a hard piece to add to gec?

-- 
Cheers,

Berend de Boer


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