win32/pthread: define _POSIX_TIMERS to notify they are not supported

This commit is contained in:
Kacper Michajłow authored and Dudemanguy committed 2023-09-29 20:48:58 +00:00
1 parent 318b5471a1
commit cdfd5c280a
10 files changed
+11 -8

No files matched your search

+1 -2
View File
@@ -69,8 +69,7 @@ struct stat_entry {
// Overflows only after I'm dead.
static int64_t get_thread_cpu_time_ns(pthread_t thread)
{
#if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 && defined(_POSIX_THREAD_CPUTIME) && \
!HAVE_WIN32_INTERNAL_PTHREADS
#if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 && defined(_POSIX_THREAD_CPUTIME)
clockid_t id;
struct timespec tv;
if (pthread_getcpuclockid(thread, &id) == 0 &&
+1
View File
@@ -17,6 +17,7 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include <pthread.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>
+1 -1
View File
@@ -17,6 +17,7 @@
#include "config.h"
#include <pthread.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -28,7 +29,6 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#include <pthread.h>
#include <assert.h>
#include "osdep/io.h"
-3
View File
@@ -357,9 +357,6 @@ win32_pthreads = get_option('win32-internal-pthreads').require(
features += {'win32-internal-pthreads': win32_pthreads.allowed()}
if features['win32-internal-pthreads']
flags += ['-isystem', '-I', '-DIN_WINPTHREAD']
# Note: Adding this include causes POSIX_TIMERS to be defined for
# unclear reasons (some confusion with <pthread.h> probably).
# Hack around it by using HAVE_WIN32_INTERNAL_PTHREADS.
includedir += include_directories('osdep/win32/include')
sources += files('osdep/win32/pthread.c')
else
+2
View File
@@ -20,6 +20,8 @@
#include <sys/types.h>
#define _POSIX_TIMERS 0
// Note: all pthread functions are mangled to make static linking easier.
#define pthread_once m_pthread_once
#define pthread_mutex_destroy m_pthread_mutex_destroy
+1 -1
View File
@@ -15,6 +15,7 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include <pthread.h>
#include <float.h>
#include <stdlib.h>
#include <inttypes.h>
@@ -24,7 +25,6 @@
#include <assert.h>
#include <time.h>
#include <math.h>
#include <pthread.h>
#include <sys/types.h>
#include <ass/ass.h>
+1 -1
View File
@@ -18,8 +18,8 @@
#ifndef MPLAYER_MP_CORE_H
#define MPLAYER_MP_CORE_H
#include <stdbool.h>
#include <pthread.h>
#include <stdbool.h>
#include "osdep/atomic.h"
+1
View File
@@ -15,6 +15,7 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include <pthread.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
+2
View File
@@ -15,6 +15,8 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include <pthread.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libavutil/opt.h>
+1
View File
@@ -15,6 +15,7 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include <pthread.h>
#include <archive.h>
#include <archive_entry.h>