Watt-32 icon indicating copy to clipboard operation
Watt-32 copied to clipboard

what is purpose of wattcp macros

Open jmalak opened this issue 4 years ago • 14 comments

Hi, I am trying to correct WATCOM tools support, because it is broken by several incostistencies as calling conventions etc. There is several macros which purpose is unclear to me and I am not able to properly fix code/make files

DOSX         it looks like the main macro to define target 
             including 32-bit and 64-bit Windows targets
WIN32        unclear purpose
_WIN32       generaly it is used for Windows header files to define WIN32 API
             but sometimes it is undefined for some unknown reason and totaly confuse building
__MSDOS__    unclear purpose

Please could you explain me purpose of these macros and relation each to other I think _WIN32 and __MSDOS__ macros are internal header macros specific for some compilers that should not be undefined or defined or used for other purpose I think DOSX macro should do what is necessary without using other macros

jmalak avatar Mar 26 '20 08:03 jmalak

Like I wrote elsewhere (I can't find it now?!), it's maybe better to add something like:

SYS_x Condition & Meaning
SYS_16BIT_SMALL __SMALL__ && __86__
SYS_16BIT_FLAT __SMALL__ && __386__
etc. etc.

Ref. how zconf.h does it. I'm confused myself after I wrote this many years ago 🤐.

gvanem avatar Mar 26 '20 12:03 gvanem

I understand. I will try to use DOSX macro whenever possible for target. It is simple to check for 16-bit code by condition DOSX==0 16-bit can be __SMALL__ or __LARGE__ others are 32-bit or 64-bit. 32-bit can be __SMALL__ or __FLAT__ 64-bit is always __FLAT__

jmalak avatar Mar 26 '20 13:03 jmalak

It is simple to check for 16-bit code by condition DOSX==0

Yes.

32-bit can be SMALL or FLAT

Maybe there should be a construction like #if (DOSX | SMALL32)? To fit the other #if (DOSX | x) tests.

gvanem avatar Mar 26 '20 13:03 gvanem

I have a next question about support for WATCOM It looks like that you suppose support for standard C99 types in stdint.h. If it is true then support for old WATCOM compilers is not working anymore and only latest version of Open Watcom compilers can be used with watt32. If it is intended then I suppose to support only Open Watcom 1.9 and above as tools for watt32 which could simplify code by removing specific things for old WATCOM compilers. It should be also stated that watt32 can be used with Open Watcom compilers 1.9 and above.

jmalak avatar Mar 27 '20 10:03 jmalak

What is the latest OW version we can get from Travis? Please give me a link.

Having and using <stdint.h> makes life so much easier. But maybe I try OW 1.9 in AppVeyor to check. Can you bundle up a small .zip for that?

It should be also stated that watt32 can be used with Open Watcom compilers 1.9 and above.

can? It's implicit that any compiler Watt-32 supports will work with the most recent compiler. Except maybe all the __attribute__ ((__gnu_inline__)) crap that changes for almost any gcc version. But no promises.

gvanem avatar Mar 27 '20 14:03 gvanem

Last oficial version is OW 1.9 which is available from OW official site ( ftp://ftp.openwatcom.org/install ), but only as installer that is not good to install on background, but there are some command line options to run installer on background.

I am maintaining OW 2.0 fork which is available from github as release snapshot or installer. OW 2.0 fork releases

Generaly best is to test it with OW 1.9, OW 2.0 is backward compatible with OW 1.9. OW 2.0 has some new functionality and is ported on 64-bit hosts.

jmalak avatar Mar 27 '20 15:03 jmalak

What host OS you are using on AppVeyor and what test platform? I will create minimized zip archive for you. I need decide what header files and libraries and executable will be necessary.

jmalak avatar Mar 28 '20 01:03 jmalak

It's a virtual installation of Win-10 64-bit I think. But I installed OW 2.0c yesterday. It worked fine.

And as the cache: keyword on AppVeyor seems to work almost every time, it's not so important the .zip is so small (LLVM + clang-cl is 700 MByte after install!). But if AppVeyor needs to download a .zip for CI, I've added this folder on OneDrive: https://1drv.ms/u/s!AtGt6tfmkhIRrhh7gnDzNIyiSdpd?e=bA9yRj

Can you check if you can access it?

gvanem avatar Mar 28 '20 08:03 gvanem

Another thing, wmake does seems to have any -nologo switch to turn off this:

Open Watcom Make Version 2.0 beta Apr 27 2014 22:18:35 (32-bit)
Copyright (c) 2002-2014 The Open Watcom Contributors. All Rights Reserved.
...

Is there a way to turn that off? On AppVeyor, I'd like a minimum of messages; on warnings and errors.

gvanem avatar Mar 28 '20 09:03 gvanem

There is wmake option -h to suppress banner.

Anyway I can access your onedrive. I have copy OW 1.9 for CI compilation in git repository it is relatively small (core tools and libraries). I will prepare minimised zip archive with standard OW tree for cross compilation on 64-bit Windows to DOS 16/32-bit and WIN32 and note you if it will be ready for use. configuration is simple by a few environment variables it doesn't need any installer.

jmalak avatar Mar 28 '20 14:03 jmalak

I enclosed minimised OW snapshot for Windows host (16/32/64) of OW 2.0 tools with support for targets - DOS 16/32-bit, Windows 32-bit

ow-snapshot.7z.002.txt ow-snapshot.7z.001.txt (remove txt extension and extract 7z archive)

jmalak avatar Mar 28 '20 16:03 jmalak

I tried these with bin/causeway.mak and noted this:

wlink  option quiet, map, verbose, eliminate, caseexact, stack=50k debug all system causeway disable 1027 name tcpinfo.e
xe file tcpinfo.obj library ..\lib\wattcpwf.lib
Warning! W1093: cannot open cwstub.exe

Since only %WATCOM%\binnt64 is in my PATH, I think you'll need to add cwstub.exe to:

  • %WATCOM%\binnt
  • %WATCOM%\binnt64

Or change wlink.lnk into:

--- a/binnt64/wlink.lnk 2020-03-26 20:48:36
+++ b/binnt64/wlink.lnk 2020-03-30 10:08:13
@@ -368,7 +368,7 @@
     option osname='CauseWay'
     libpath %WATCOM%/lib386
     libpath %WATCOM%/lib386/dos
-    op stub=cwstub.exe
+    op stub=../binw/cwstub.exe
     format os2 le ^
 end

gvanem avatar Mar 30 '20 10:03 gvanem

the problem is that proper path should include dirs for all target platform that it should include bint and binw if you want win32 and dos. it is how standard ow instalation looks like.

Dne po 30. 3. 2020 12:11 uživatel Gisle Vanem [email protected] napsal:

I tried these with bin/causeway.mak and noted this:

wlink option quiet, map, verbose, eliminate, caseexact, stack=50k debug all system causeway disable 1027 name tcpinfo.e xe file tcpinfo.obj library ..\lib\wattcpwf.lib Warning! W1093: cannot open cwstub.exe

Since only %WATCOM%\binnt64 is in my PATH, I think you'll need to add cwstub.exe to:

  • %WATCOM%\binnt
  • %WATCOM%\binnt64

Or change wlink.lnk into:

--- a/binnt64/wlink.lnk 2020-03-26 20:48:36+++ b/binnt64/wlink.lnk 2020-03-30 10:08:13@@ -368,7 +368,7 @@ option osname='CauseWay' libpath %WATCOM%/lib386 libpath %WATCOM%/lib386/dos- op stub=cwstub.exe+ op stub=../binw/cwstub.exe format os2 le ^ end

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gvanem/Watt-32/issues/17#issuecomment-605910330, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPMP3EV2X4EERMN56PV5BLRKBV4XANCNFSM4LUBH5PQ .

jmalak avatar Mar 30 '20 10:03 jmalak

anyway simple solution is copy stub executable to binnt65

Dne po 30. 3. 2020 12:11 uživatel Gisle Vanem [email protected] napsal:

I tried these with bin/causeway.mak and noted this:

wlink option quiet, map, verbose, eliminate, caseexact, stack=50k debug all system causeway disable 1027 name tcpinfo.e xe file tcpinfo.obj library ..\lib\wattcpwf.lib Warning! W1093: cannot open cwstub.exe

Since only %WATCOM%\binnt64 is in my PATH, I think you'll need to add cwstub.exe to:

  • %WATCOM%\binnt
  • %WATCOM%\binnt64

Or change wlink.lnk into:

--- a/binnt64/wlink.lnk 2020-03-26 20:48:36+++ b/binnt64/wlink.lnk 2020-03-30 10:08:13@@ -368,7 +368,7 @@ option osname='CauseWay' libpath %WATCOM%/lib386 libpath %WATCOM%/lib386/dos- op stub=cwstub.exe+ op stub=../binw/cwstub.exe format os2 le ^ end

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gvanem/Watt-32/issues/17#issuecomment-605910330, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPMP3EV2X4EERMN56PV5BLRKBV4XANCNFSM4LUBH5PQ .

jmalak avatar Mar 30 '20 10:03 jmalak