Re: Calling C++ procedures from Ada - Linkage problem



Ken Resander wrote:

[...]
> /*
> void calltosee ( )
> {
> //  called this from a c++ program compiled and linked by
> //  VC6. Used disassembler in debug window and
> //  found that:
> int h ;
> char dst [ 100 ] ;
> openhandler_c ( &h) ;  // this contains a _chkesp call
[...]

Well, it seems that VC++ is generating the stack checking stuff. A web
search seems to reveal that this is only when "VC generates debug
code" (whatever this means). ;) So I'd say, switch VC to "release code
generation" (whatever that might mean) or just declare an Ada routine
called chkesp with C interface (well, "pragma Inline" won't work then,
I suppose).

BTW, according to

<URI:http://www.winehq.com/hypermail/wine-patches/2003/03/att-0132/01-msvcrt_chesp.diff>

the routine is contained in the msvcrt dll.


Vinzent.

--
worst case: The wrong assumption there actually is one.
.