From 84d90d6ed85853eecb3ea17f1f23d3a5d7e8d264 Mon Sep 17 00:00:00 2001 From: Hank Anderson Date: Wed, 25 Feb 2015 11:52:25 -0600 Subject: [PATCH] Fixed some compiler errors/warnings for clang. --- common.h | 2 +- cpuid_x86.c | 4 ++-- driver/others/memory.c | 4 ++-- kernel/arm/zdot.c | 6 +++++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/common.h b/common.h index 0761f5536..0a7bb66bc 100644 --- a/common.h +++ b/common.h @@ -310,7 +310,7 @@ typedef int blasint; #endif #if defined(OS_WINDOWS) -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) #define YIELDING YieldProcessor() #else #define YIELDING SwitchToThread() diff --git a/cpuid_x86.c b/cpuid_x86.c index 6b7e408d8..8a8a802a0 100644 --- a/cpuid_x86.c +++ b/cpuid_x86.c @@ -40,7 +40,7 @@ #include #include "cpuid.h" -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) #define C_INLINE __inline #else #define C_INLINE inline @@ -154,7 +154,7 @@ static C_INLINE int have_excpuid(void){ #ifndef NO_AVX static C_INLINE void xgetbv(int op, int * eax, int * edx){ //Use binary code for xgetbv -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) *eax = __xgetbv(op); #else __asm__ __volatile__ diff --git a/driver/others/memory.c b/driver/others/memory.c index 16d68cced..fa364785b 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -769,12 +769,12 @@ static void *alloc_hugetlb(void *address){ if (LookupPrivilegeValue(NULL, SE_LOCK_MEMORY_NAME, &tp.Privileges[0].Luid) != TRUE) { CloseHandle(hToken); - return -1; + return (void*)-1; } if (AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL) != TRUE) { CloseHandle(hToken); - return -1; + return (void*)-1; } map_address = (void *)VirtualAlloc(address, diff --git a/kernel/arm/zdot.c b/kernel/arm/zdot.c index 469487531..198104022 100644 --- a/kernel/arm/zdot.c +++ b/kernel/arm/zdot.c @@ -35,9 +35,13 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. **************************************************************************************/ #include "common.h" -#include +#ifndef _MSC_VER +#include FLOAT _Complex CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y) +#else +openblas_complex_double CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y) +#endif { BLASLONG i=0; BLASLONG ix=0,iy=0;