From 371663f0c26bc4384406c65e18e1066a5ab89f7e Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Mon, 22 Dec 2025 15:36:06 -0500 Subject: [PATCH 1/3] fix define for YIELDING The intent is to define this as nop, but previously it was then immediately overriding it for various architectures, causing a compiler warning on Windows. --- common.h | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/common.h b/common.h index 512096ca1d..989828d064 100644 --- a/common.h +++ b/common.h @@ -362,18 +362,6 @@ typedef int blasint; #define MAX_CPU_NUMBER 2 #endif -#if defined(OS_SUNOS) -#define YIELDING thr_yield() -#endif - -#if defined(OS_WINDOWS) -#if defined(_MSC_VER) && !defined(__clang__) -#define YIELDING YieldProcessor() -#else -#define YIELDING SwitchToThread() -#endif -#endif - #if defined(ARMV7) || defined(ARMV6) || defined(ARMV8) || defined(ARMV5) #define YIELDING __asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop; \n"); #endif @@ -398,14 +386,25 @@ typedef int blasint; #endif #endif - #ifdef __EMSCRIPTEN__ #define YIELDING #endif #ifndef YIELDING +#if defined(OS_SUNOS) +#define YIELDING thr_yield() + +#elif defined(OS_WINDOWS) +# if defined(_MSC_VER) && !defined(__clang__) +# define YIELDING YieldProcessor() +# else +# define YIELDING SwitchToThread() +# endif + +#else #define YIELDING sched_yield() #endif +#endif /*** To alloc job_t on heap or stack. From fed16d638c7736b4d46db1336c51ca7893ab3c43 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 24 Dec 2025 17:47:48 -0500 Subject: [PATCH 2/3] Update common.h --- common.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/common.h b/common.h index 989828d064..c0097a8645 100644 --- a/common.h +++ b/common.h @@ -390,18 +390,19 @@ typedef int blasint; #define YIELDING #endif +#if defined(_MSC_VER) && !defined(__clang__) +#undef YIELDING // MSVC doesn't support assembly code +#define YIELDING YieldProcessor() +#endif + #ifndef YIELDING #if defined(OS_SUNOS) #define YIELDING thr_yield() #elif defined(OS_WINDOWS) -# if defined(_MSC_VER) && !defined(__clang__) -# define YIELDING YieldProcessor() -# else -# define YIELDING SwitchToThread() -# endif +#define YIELDING SwitchToThread() -#else +#else // assume linux #define YIELDING sched_yield() #endif #endif From 0b2b58322388deddeede4832986789347fdede3b Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 24 Dec 2025 21:47:03 -0500 Subject: [PATCH 3/3] POSIX.1-2008 --- common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.h b/common.h index c0097a8645..40dbd3dfcd 100644 --- a/common.h +++ b/common.h @@ -402,7 +402,7 @@ typedef int blasint; #elif defined(OS_WINDOWS) #define YIELDING SwitchToThread() -#else // assume linux +#else // assume POSIX.1-2008 #define YIELDING sched_yield() #endif #endif