Please let me know if patches in 0005.txt and 0006.txt are ok. I would like to 
reorder them before large changes.

- Kirill Makurin

________________________________
From: LIU Hao
Sent: Saturday, April 19, 2025 11:05 PM
To: Kirill Makurin; mingw-w64-public@lists.sourceforge.net
Subject: Re: [Mingw-w64-public] winpthreads: add support for _USE_32BIT_TIME_T 
and _TIME_BITS macros

在 2025-4-19 21:45, Kirill Makurin 写道:
> `SIZEOF_TIME_T` is defined in config.h as the result of 
> `AC_CHECK_SIZEOF(time_t)` added to configure.ac.
> (I did not included result from running `autoreconf` in the patches).
>
> Thanks for noticing usage of `inline`, I think it also makes sense for 
> existing `WINPTHREADS_INLINE `.
>
> The `WINPTHREAD_DBG` seems to be used to enable some additional debug output. 
> I didn't notice that
> function protected with this macro are not used at all. I think we're good to 
> get rid of this macro?

In source files we can check for `_USE_32BIT_TIME_T`.

I kinda think it's not correct to use configure to check for size of `time_t`, 
as it's part of ABI and
can't be changed; had better be hard-coded.


> Reuse of inline definitions should be possible, I think. If not the libtool 
> issue, I would prefer to have
> a .def file which has something like this

DEF is for the shared library only, so doesn't seem an option.


> I also forgot to mention setting of `errno` to `ERANGE` in clock_gettime32 if 
> time does not fit in 32bit
> time_t. Is there any better `errno` value for this?

https://pubs.opengroup.org/onlinepubs/9799919799/functions/clock_gettime.html

    The clock_gettime() function shall fail if:

    [EOVERFLOW]
    The number of seconds will not fit in an object of type time_t.


--
Best regards,
LIU Hao

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to