Pelles C forum

C language => Expert questions => Topic started by: TimoVJL on July 28, 2010, 10:48:44 PM

Title: Is there Open Watcom users who use poide with it
Post by: TimoVJL on July 28, 2010, 10:48:44 PM
I'm testing Open Watcom C 32 compiler with poide.exe.
My first interest are those cl386.exe and link386.exe.
There seems to be some problems with some options that doesn't work at all like -Zl (nodefaultlib) etc...
Debug info CodeView doesn't work either it's just NB09 and poide.exe want's NB11 ?

Title: Re: Is there Open Watcom users who use poide with it
Post by: Vortex on July 29, 2010, 07:32:51 PM
Hi timovjl,

Does Open Watcom support the MS COFF object file output? I remember that they have a special name decoration system in object files.
Title: Re: Is there Open Watcom users who use poide with it
Post by: TimoVJL on July 29, 2010, 10:05:45 PM
Quote
Does Open Watcom support the MS COFF object file output?
No just OMF i think.
Quote
I remember that they have a special name decoration system in object files.
__cdecl    foo
__stdcall  foo@0
__watcall foo_

EDIT 20100811: Open Watcom C 32 without CRT library.
                      use -s switch and link with objectfile OWCNoCrt.obj.

Code: [Select]
; Open Watcom C 32 NoCrt startup code OWCNoCrt
; use WinMainCRTStartup as new stating point like MS linker do
; compile this with wasm -bt=nt -3r -ms OWCNorCrt.asm

.386p
.model flat, stdcall

        extrn   WinMainCRTStartup : near
public wstart_
.code
wstart_:
        jmp     WinMainCRTStartup
end wstart_

Here is Vortex code ported to wasm:
Code: [Select]
; Open Watcom C 32 NoCrt startup code OWCCrt0Gui
; compile this with wasm -bt=nt -3r -ms OWCCrt0Gui.asm
; wlib OWCCrt0Gui OWCCrt0Gui
; Based on Vortex crt0gui.asm

.386p
.model flat, stdcall

extrn ExitProcess@4 : near
extrn GetCommandLineA@0 : near
extrn GetModuleHandleA@4 : near
; extrn WinMainCRTStartup : near
extrn WinMain@16 : near
public wstart_

SW_SHOWDEFAULT equ 10
NULL equ 0

.data?
hInstance DWORD ?

.code
wstart_:
; jmp WinMainCRTStartup
push 0
call GetModuleHandleA@4
mov hInstance,eax
call GetCommandLineA@0
cmp byte PTR [eax],34 ;check for leading quote
jne skipfile
@@: ;look for the second quote
inc eax
mov cl,byte PTR [eax]
or cl,cl
jz finish
cmp cl,34
jne @b
jmp skipspace ;look for space chars
repeat1:
inc eax
skipfile: ;skip file name
mov cl,byte PTR [eax]
or cl,cl
jz finish
cmp cl,32
jne repeat1
dec eax
skipspace: ;skip space chars
inc eax
mov cl,byte PTR [eax]
cmp cl,32
je skipspace
finish:
push SW_SHOWDEFAULT
push eax
push NULL
push hInstance
call WinMain@16
push eax
call ExitProcess@4
end wstart_
Title: Re: Is there Open Watcom users who use poide with it
Post by: Vortex on August 07, 2010, 09:53:17 AM
Hi timovjl,

Many thanks for the code. If it's possible, could you post a Pelles C project using your converted module?

Once again, much appreciated.

Vortex
Title: Re: Is there Open Watcom users who use poide with it
Post by: TimoVJL on August 07, 2010, 10:22:48 AM
Here:
WinMinOWC.zip

BTW:
Open Watcom snapshot:
http://owbuilder.malakovi.cz/snapshot/ (http://owbuilder.malakovi.cz/snapshot/)
There is csetup.zip if you dont want to install it.

Title: Re: Is there Open Watcom users who use poide with it
Post by: Vortex on August 08, 2010, 11:43:19 AM
Hi timovjl,

Thanks for the sample project. It works fine.