www.digitalmars.com         C & C++   DMDScript  

c++.dos - Could I use -mx switch and still have stdcall suffixes?

reply Japheth <mail japheth.de> writes:
Hello,

the -mx switch (for DOSX 32) instruct the compiler to generate 32bit code in a 
non-flat SMALL model, which is what I need. But I also need the full MS 
compatible __stdcall decoration, which is a "_" prefix and a " xx" suffix. 
With the -mx switch it seems impossible to get this. Or am I missing something?
Sep 30 2005
parent reply "Walter Bright" <newshound digitalmars.com> writes:
"Japheth" <mail japheth.de> wrote in message
news:dhipoc$vbq$1 digitaldaemon.com...
 Hello,

 the -mx switch (for DOSX 32) instruct the compiler to generate 32bit code

 non-flat SMALL model, which is what I need. But I also need the full MS
 compatible __stdcall decoration, which is a "_" prefix and a " xx" suffix.
 With the -mx switch it seems impossible to get this. Or am I missing

It should give you that if you use __stdcall.
Sep 30 2005
parent reply Japheth <mail japheth.de> writes:
 
 It should give you that if you use __stdcall.
 

Thanks, but I don't succeed. This is my test case (sample.c): //----------------------------------------------- void __stdcall ExitProcess(long uExitCode); int main() { ExitProcess(0); return 0; } //----------------------------------------------- and the compiler is called with: \dm\bin\dmc -c -mx sample.c but in the resulting object module there is only an external _ExitProcess, but I would like to have _ExitProcess 4. BTW: this is for a self-written dos extender, which has a built-in win32 emulation written in MASM, and MASM decorates the names with the suffix xx. It works for flat model, but I would like to have it in 32bit small as well.
Sep 30 2005
parent "Walter Bright" <newshound digitalmars.com> writes:
"Japheth" <mail japheth.de> wrote in message
news:dhj020$162e$1 digitaldaemon.com...
 It should give you that if you use __stdcall.

Thanks, but I don't succeed. This is my test case (sample.c):

You're right, it won't do the name decoration for the x model.
 BTW: this is for a self-written dos extender, which has a built-in win32
 emulation written in MASM, and MASM decorates the names with the suffix

 It works for flat model, but I would like to have it in 32bit small as

You can get it to work by writing some jumps: _ExitProcess: jmp _ExitProcess 4 or by using a module definition file to map the names.
Oct 02 2005