The `pthread.h`, `pthread_time.h` and `sched.h` include `sys/timeb.h`. The 
`ftime` function was marked obsolete and later removed in POSIX 2008.

I don't see any reason to include this header file unless some legacy projects 
rely on `ftime` being available when including `pthread.h`, which seems strange 
to me.

None of source files use `ftime`. There are some tests in `tests_pthread` 
subdirectory that use it, but the explicitly include `sys/timeb.h`.

- Kirill Makurin
From 8845189f7a9a0943d2eeea437a7299993c64da0f Mon Sep 17 00:00:00 2001
From: Kirill Makurin <maiddais...@outlook.com>
Date: Sun, 16 Feb 2025 22:35:14 +0900
Subject: [PATCH] winpthreads: do not include sys/timeb.h from public headers

Signed-off-by: Kirill Makurin <maiddais...@outlook.com>
---
 mingw-w64-libraries/winpthreads/include/pthread.h      | 2 --
 mingw-w64-libraries/winpthreads/include/pthread_time.h | 2 --
 mingw-w64-libraries/winpthreads/include/sched.h        | 2 --
 3 files changed, 6 deletions(-)

diff --git a/mingw-w64-libraries/winpthreads/include/pthread.h 
b/mingw-w64-libraries/winpthreads/include/pthread.h
index 36b2f6cae..bc9735924 100644
--- a/mingw-w64-libraries/winpthreads/include/pthread.h
+++ b/mingw-w64-libraries/winpthreads/include/pthread.h
@@ -68,8 +68,6 @@
 #include <signal.h>
 #include <time.h>
 
-#include <sys/timeb.h>
-
 #include "pthread_compat.h"
 #include "sched.h"
 
diff --git a/mingw-w64-libraries/winpthreads/include/pthread_time.h 
b/mingw-w64-libraries/winpthreads/include/pthread_time.h
index 72f8446a6..363154d67 100644
--- a/mingw-w64-libraries/winpthreads/include/pthread_time.h
+++ b/mingw-w64-libraries/winpthreads/include/pthread_time.h
@@ -20,8 +20,6 @@
    DEALINGS IN THE SOFTWARE.
 */
 
-#include <sys/timeb.h>
-
 #ifndef WIN_PTHREADS_TIME_H
 #define WIN_PTHREADS_TIME_H
 
diff --git a/mingw-w64-libraries/winpthreads/include/sched.h 
b/mingw-w64-libraries/winpthreads/include/sched.h
index 758d81891..abbf5cf0d 100644
--- a/mingw-w64-libraries/winpthreads/include/sched.h
+++ b/mingw-w64-libraries/winpthreads/include/sched.h
@@ -30,8 +30,6 @@
 #include <limits.h>
 #include <signal.h>
 
-#include <sys/timeb.h>
-
 #include "pthread_compat.h"
 
 /* Some POSIX realtime extensions, mostly stubbed */
-- 
2.46.1.windows.1

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

Reply via email to