Re: ver 4.0 c_func problem on WIN98 Here Is proof of the problem !

new topic     » goto parent     » topic index » view thread      » older message » newer message
bernie said...

Jim I built all my binaries on XP using OpenWatcom Ver 1.8.

Can you confirm that the code works correctly on XP? Even if called with '+' ?

bernie said...

The program should run on any Euphoria binary no matter what compiler the binary was built with.

Agreed. This is a bug of eui.exe/euiw.exe

bernie said...

As far as the calling convention if I am calling my own internal code in my program I am controlling what I do to the stack so that should not matter.

This is wrong.

You call

tok = c_func(rid, {b,d})

So we need to know the correct calling convention to pass the arguments (b and d) onto the stack to the machine code, and then we need to know the convention again to obtain the correct return value.

Thus, for the call to rid to be successful, the calling convention is important. You can't just assume that c_func() will magically know the right thing to do.

However,

1. The default calling convetion on Windows is STDCALL (and '+' means CDECL). 2. Your machine code appears to be using STDCALL, if i understand the assembly languge correctly.

Therefore, this example should have worked on w98.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu