Browse Source

Added MSVC defines to common.h.

Don't have unistd.h in MSVC.

Chagned YIELDING to use the YeildProcessor macro.
tags/v0.2.15^2
Hank Anderson 11 years ago
parent
commit
5d3fc092e9
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      common.h

+ 7
- 0
common.h View File

@@ -82,7 +82,10 @@ extern "C" {
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

#if !defined(_MSC_VER)
#include <unistd.h> #include <unistd.h>
#endif


#ifdef OS_LINUX #ifdef OS_LINUX
#include <malloc.h> #include <malloc.h>
@@ -307,8 +310,12 @@ typedef int blasint;
#endif #endif


#if defined(OS_WINDOWS) #if defined(OS_WINDOWS)
#ifdef _MSC_VER
#define YIELDING YieldProcessor()
#else
#define YIELDING SwitchToThread() #define YIELDING SwitchToThread()
#endif #endif
#endif


#if defined(ARMV7) || defined(ARMV6) || defined(ARMV8) || defined(ARMV5) #if defined(ARMV7) || defined(ARMV6) || defined(ARMV8) || defined(ARMV5)
#define YIELDING asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop; \n"); #define YIELDING asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop; \n");


Loading…
Cancel
Save