info-mtools
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Info-mtools] [patch] windows: support Open Watcom V2 compiler (atte


From: Alain Knaff
Subject: Re: [Info-mtools] [patch] windows: support Open Watcom V2 compiler (attempt 3)
Date: Mon, 3 Feb 2025 07:46:48 +0100
User-agent: Mozilla Thunderbird

Hi,

On 02/02/2025 14:15, avih wrote:
[...]
>> Another thing that I've been wondering about is the direct.h include
>> apparently needed by Watcom. I'm wondering whether to autodetect that in
>> configure.ac.
> 
> I think it's viable, maybe move it to sysincludes.h, maybe win-only.
> 
> direct.h ia an official Windows header which is documented as required
> for mkdir. I'm guessing that in mingw it gets included indirectly.
> 
> 
>> Maybe I can better make up my mind if I know:
>> - if direct.h is still needed for current mtools?
>> - if yes, for which function prototype(s) is it needed?
> 
> Yes, it's still required with Watcom for opendir, DIR, etc.
> 
> opendir is not a Windows API, but it is supported with POSIX semantics
> in mingw via the posix extension dirent.h, and in Watcom via direct.h
> (the standard windows header, with opendir and friends added).
> 
> https://open-watcom.github.io/open-watcom-v2-wikidocs/clib.html#opendir

I get from this that (in the context of mtools) it would only be needed
as a fallback if dirent.h is not available.

So, I added a check to configure.ac that checks for direct.h only if
dirent.h does not exist, and conditionally includes it in unixdir.c
(same place where dirent.h is included... directory functions are only
used in unixdir.c)

[...]
> r885 (pointer arithmetic):
> - there's still this warning in 64 build (long is 32 on Windows):
> file.c: In function ‘func1’:
> file.c:632:47: warning: cast from pointer to integer of different size 
> [-Wpointer-to-int-cast]
>   632 |         return getAbsCluNr(This) ^ (uint32_t) (unsigned long) 
> This->head.Next;
>       |                                               ^

I'm now using uintmax_t for this.

Intermediary cast was needed to avoid this warning :-)

[...]
> r992 (mtype usage):
> - Nit: mcopy still doesn't show: mcopy [-tnvm] MSDOSsourcefile
>   (I had to check the html docs to understand why it doesn't fail)

Added now

Regards,

Alain




reply via email to

[Prev in Thread] Current Thread [Next in Thread]