Henry, Henry Sobotka wrote:
> Julien Pierre wrote: > > > > What's the default calling convention for the EMX/gcc compiler ? > > "gcc"? I've never seen a name for it but the docs imply it's whatever > the standard calling convention on Unix systems is. I meant on the EMX/gcc compiler OS/2. What does it use by default if no calling convention is specified ? > > I'm trying to integrate some assembly code to optimize the crypto > > library. It's now working in the VACPP build of NSS. The code uses > > __cdecl calling convention however. Is this available in EMX/gcc for > > OS/2 ? And is it the default calling convention or does it need > > specifiers in function declarations ? > > gcc supports cdecl on i386. Functions have to be specified as: > void foo (void) __attribute__ ((cdecl)); > > I only played around with it a little not long ago testing stdcall, and > from looking at the assembler file, it appeared to be doing the right > thing. > > BTW, your asm also has to be AT&T syntax. If there's a linux version of > the code, it will very likely work out-of-the-box with emx+gcc. There is a Linux version of the asm code that assembles with gas. It also uses cdecl calling convention. However, the C header does not declare any calling convention for any platform. There isn't even a macro. If cdecl isn't the default then the header will have to be modified for gcc , like I had to modify it for VAC to explicitly state "__cdecl", otherwise _Optlink was used.
