1. 2.4 alpha-test release

Hi Robert,

Will 2.4 have native support for CDecl DLLs?  I know there's a library 
available for this but it's rather a pain to work with IMO.  This is 
pretty much all I'm looking for right now before I buy another version 
of the interpreter.

Thanks,
-- Brian

new topic     » topic index » view message » categorize

2. Re: 2.4 alpha-test release

Brian Broker writes:
> Will 2.4 have native support for CDecl DLLs?

Yes. I've been working on this lately.
After much study of assembly code,
and a lot of testing, I've confirmed that the 
interpreter (built by Watcom),
and the translator using Watcom,
can *already* call both stdcall and cdecl dlls.
Do you have any counter examples?

I've added cdecl support for Borland and Lcc. 
You just have to add a '+' to the function name 
in define_c_func/proc to indicate that it uses 
the cdecl calling convention.

I also plan to allow Euphoria cdecl callback routines.
Currently, callbacks are stdcall.

By the way, Watcom does not exactly agree with
the rest of the world as to the cdecl convention,
but that won't affect us unless your dll is built using Watcom.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: 2.4 alpha-test release

Andy Serpa writes:
> Are you saying translated programs compiled with Watcom 
> can call cdecl unmodified?  If that's what you are saying, 
> then yes, I have counter-examples...

Using exw.exe, or translated code compiled by Watcom,
you should currently be able to call cdecl routines compiled by 
most C compilers, but (very strangely) *not* those compiled by 
Watcom itself. Watcom's version of cdecl differs 
(in the area of floating-point return values) from most other 
C compilers. There may be other non-standard C compilers 
out there as well. 

The fact that there is so much incompatibility
in the Windows C/C++ world is appalling. It's very difficult to
compile a dll with one C compiler and call it
from code compiled by another compiler.
The fact that there are 2 (or more, did I mention fastcall?) 
calling conventions is bad enough, but you also have 
disagreements in the way that routines are named 
in the object files, making linking a problem.

Things aren't so bad with stdcall, because the whole
WIN32 API is stdcall, and everyone needs to be
compatible with that.

Anyway, I'd like to hear about your examples.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu