From fbea9607be7aa7b650173fe7ac04c044e4e6609f Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Fri, 8 Mar 2024 03:05:48 -0500 Subject: [PATCH] osdep/threads: fix warning: initializer element is not constant --- osdep/threads-posix.h | 2 +- osdep/threads-win32.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osdep/threads-posix.h b/osdep/threads-posix.h index b930506958..4b3bb902ac 100644 --- a/osdep/threads-posix.h +++ b/osdep/threads-posix.h @@ -102,7 +102,7 @@ typedef pthread_once_t mp_once; typedef pthread_t mp_thread_id; typedef pthread_t mp_thread; -#define MP_STATIC_COND_INITIALIZER (mp_cond){ .cond = PTHREAD_COND_INITIALIZER, .clk_id = CLOCK_REALTIME } +#define MP_STATIC_COND_INITIALIZER { .cond = PTHREAD_COND_INITIALIZER, .clk_id = CLOCK_REALTIME } #define MP_STATIC_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER #define MP_STATIC_ONCE_INITIALIZER PTHREAD_ONCE_INIT diff --git a/osdep/threads-win32.h b/osdep/threads-win32.h index dbce353a92..f1c654a5cb 100644 --- a/osdep/threads-win32.h +++ b/osdep/threads-win32.h @@ -39,7 +39,7 @@ typedef HANDLE mp_thread; typedef DWORD mp_thread_id; #define MP_STATIC_COND_INITIALIZER CONDITION_VARIABLE_INIT -#define MP_STATIC_MUTEX_INITIALIZER (mp_mutex){ .srw = SRWLOCK_INIT } +#define MP_STATIC_MUTEX_INITIALIZER { .srw = SRWLOCK_INIT } #define MP_STATIC_ONCE_INITIALIZER INIT_ONCE_STATIC_INIT static inline int mp_mutex_init_type_internal(mp_mutex *mutex, enum mp_mutex_type mtype)