Remove pthread code for Windows older than Vista

Assume the CONDITION_VARIABLE added in Windows Vista is available.

Remove an unneeded WaitForSingleObject() macro that converts
WaitForSingleObject() calls to WaitForSingleObjectEx() calls with
bAlertable=FALSE. The WaitForSingleObject() function does not enter an
alertable wait state, so it is equivalent to WaitForSingleObjectEx()
with bAlertable=FALSE.

Remove code for Windows older than Vista in src/dsp/cpu.h.

Change-Id: I7df95557713923e05a7bfb62e095ec6172cfd708
This commit is contained in:
Wan-Teh Chang
2025-08-02 08:09:14 -07:00
parent c41d168d25
commit ac2795e904
2 changed files with 10 additions and 79 deletions

View File

@@ -193,7 +193,9 @@
#if defined(_WIN32)
#include <windows.h>
#if _WIN32_WINNT >= 0x0600
#if _WIN32_WINNT < 0x0600
#error _WIN32_WINNT must target Windows Vista / Server 2008 or newer.
#endif
// clang-format off
#define WEBP_DSP_INIT_VARS(func) \
static VP8CPUInfo func##_last_cpuinfo_used = \
@@ -207,20 +209,7 @@
ReleaseSRWLockExclusive(&func##_lock); \
} while (0)
// clang-format on
#else // _WIN32_WINNT < 0x0600
// clang-format off
#define WEBP_DSP_INIT_VARS(func) \
static volatile VP8CPUInfo func##_last_cpuinfo_used = \
(VP8CPUInfo)&func##_last_cpuinfo_used
#define WEBP_DSP_INIT(func) \
do { \
if (func##_last_cpuinfo_used == VP8GetCPUInfo) break; \
func(); \
func##_last_cpuinfo_used = VP8GetCPUInfo; \
} while (0)
// clang-format on
#endif // _WIN32_WINNT >= 0x0600
#else // !defined(_WIN32)
#else // !defined(_WIN32)
// NOLINTNEXTLINE
#include <pthread.h>