在 2025-4-15 10:22, Kirill Makurin 写道:
--- a/mingw-w64-libraries/winpthreads/include/pthread_compat.h +++ b/mingw-w64-libraries/winpthreads/include/pthread_compat.h @@ -98,6 +98,7 @@ typedef unsigned short mode_t; #ifdef __GNUC__#define WINPTHREADS_INLINE inline+#define WINPTHREADS_ALWAYS_INLINE inline __attribute__((__always_inline__))
For c89 compatibility, `inline` should be `__inline__`. Ref: https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html
+#if SIZEOF_TIME_T == 8 + return clock_getres64 (clock_id, (struct _timespec64 *) res); +#else + return clock_getres32 (clock_id, (struct _timespec32 *) res); +#endif
Where is `SIZEOF_TIME_T` defined? Instead of ``` #ifdef IN_WINPTHREAD WINPTHREAD_API int __cdecl nanosleep(const struct timespec *request, struct timespec *remain); #elsestatic WINPTHREADS_ALWAYS_INLINE int __cdecl nanosleep(const struct timespec *request, struct timespec *remain)
{ ... ``` Is it possible to reuse the inline definitions from headers? ``` #ifdef IN_WINPTHREAD WINPTHREAD_API #else static WINPTHREADS_ALWAYS_INLINE #else int __cdecl nanosleep(const struct timespec *request, struct timespec *remain) { ... ```
Other notes: Makefile.am currently unconditionally defines `WINPTHREAD_DBG=1`, maybe it would make sense to add an option which will control whether this macro is defined?
AFAICT it enables functions that are not exported from the DLL (only from the static library), so it is not very useful. Can it be removed?
I would like to move definition of `WIN32_LEAN_AND_MEAN` from Makefile.am to source files (just before `#include <windows.h>`.
Yes it makes sense. -- Best regards, LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public