Author Topic: Are Oxygen functions CDECL or SDECL?  (Read 1182 times)

0 Members and 1 Guest are viewing this topic.

Brian Alvarez

  • Guest
Are Oxygen functions CDECL or SDECL?
« on: December 20, 2018, 05:41:22 PM »

 Hello Charles, title says it all. Im trying to implement CDECL and SDECL, but i dont know what direction does Oxygen
pushes parameters to subs and functions. Is there already a silent goodie regarding this?


Charles Pegge

  • Guest
Re: Are Oxygen functions CDECL or SDECL?
« Reply #1 on: December 21, 2018, 01:40:02 AM »
Hi Brian,

o2 supports stdcall (default) and cdecl for 32-bit systems, and ms64 (default) for 64bit-systems. These standards only apply to imported/exported functions and virtual objects.

Brian Alvarez

  • Guest
Re: Are Oxygen functions CDECL or SDECL?
« Reply #2 on: December 21, 2018, 01:17:22 PM »
 In other words, they get automatically adjusted for standards automatically?
can they be changed manually? If they can't, no problem, i just want to know if
there is a switch.

 For example, can exported modules use SDECL?

Charles Pegge

  • Guest
Re: Are Oxygen functions CDECL or SDECL?
« Reply #3 on: December 23, 2018, 03:22:18 PM »
CDECL is the only one you would ever need to specify, and that is confined to 32-bit systems. There is only one calling convention for MS 64-bit.

You can specify cdecl for a whole block of functions:

This is the start of MSVCRT.INC:

Code: [Select]
#ifndef mode64bit
  extern lib "Msvcrt.dll" cdecl
#else
  extern lib "Msvcrt.dll"
#endif