diff --git a/control/magma_internal.h b/control/magma_internal.h index 7af16a5..0133e44 100644 --- a/control/magma_internal.h +++ b/control/magma_internal.h @@ -33,7 +33,7 @@ // functions where Microsoft fails to provide C99 standard // (only with Microsoft, not with nvcc on Windows) // in both magma_internal.h and testings.h - #ifndef __NVCC__ + #if !defined(__NVCC__) && !defined(__clang__) #include #define copysign(x,y) _copysign(x,y) @@ -43,6 +43,9 @@ // note _snprintf has slightly different semantics than snprintf #define snprintf _snprintf + #elif !defined(__NVCC__) + // make sure this actually uses the C version and not the C++ overloads + #define copysign(x,y) copysign((double)x,(double)y) #endif #else