diff --git a/matlab.h b/matlab.h index 1d9f6ac..0547ceb 100644 --- a/matlab.h +++ b/matlab.h @@ -161,7 +161,7 @@ mxArray* wrap(const bool& value) { } // specialization to size_t but skip Win64 size check & CUDACC check -#if !defined(_WIN64) || defined(__CUDACC__) +#if (!defined(_WIN64) && !defined(__LP64__)) || defined(__CUDACC__) template<> mxArray* wrap(const size_t& value) { mxArray *result = scalar(mxUINT32OR64_CLASS); @@ -351,7 +351,7 @@ uint64_t unwrap(const mxArray* array) { // specialization to size_t; omit it on Win64 because size_t is uint64_t there // and would duplicate unwrap. The __CUDACC__ case intentionally // bypasses the Win64 guard when compiling with CUDA. -#if !defined(_WIN64) || defined(__CUDACC__) +#if (!defined(_WIN64) && !defined(__LP64__)) || defined(__CUDACC__) template<> size_t unwrap(const mxArray* array) { checkScalar(array, "unwrap");