From 211bba1bad6ec27c2c43d0a0100b65247b1aff43 Mon Sep 17 00:00:00 2001 From: Sven Angerer Date: Sat, 30 May 2026 16:04:48 +0200 Subject: [PATCH] fix: guard size_t template specializations for 64-bit Unix (__LP64__) --- matlab.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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");