Skip to content

Commit 371663f

Browse files
committed
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.
1 parent 68ff451 commit 371663f

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

common.h

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -362,18 +362,6 @@ typedef int blasint;
362362
#define MAX_CPU_NUMBER 2
363363
#endif
364364

365-
#if defined(OS_SUNOS)
366-
#define YIELDING thr_yield()
367-
#endif
368-
369-
#if defined(OS_WINDOWS)
370-
#if defined(_MSC_VER) && !defined(__clang__)
371-
#define YIELDING YieldProcessor()
372-
#else
373-
#define YIELDING SwitchToThread()
374-
#endif
375-
#endif
376-
377365
#if defined(ARMV7) || defined(ARMV6) || defined(ARMV8) || defined(ARMV5)
378366
#define YIELDING __asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop; \n");
379367
#endif
@@ -398,14 +386,25 @@ typedef int blasint;
398386
#endif
399387
#endif
400388

401-
402389
#ifdef __EMSCRIPTEN__
403390
#define YIELDING
404391
#endif
405392

406393
#ifndef YIELDING
394+
#if defined(OS_SUNOS)
395+
#define YIELDING thr_yield()
396+
397+
#elif defined(OS_WINDOWS)
398+
# if defined(_MSC_VER) && !defined(__clang__)
399+
# define YIELDING YieldProcessor()
400+
# else
401+
# define YIELDING SwitchToThread()
402+
# endif
403+
404+
#else
407405
#define YIELDING sched_yield()
408406
#endif
407+
#endif
409408

410409
/***
411410
To alloc job_t on heap or stack.

0 commit comments

Comments
 (0)