From 6743274b3182093dbee9a41836a14971331f5a3d Mon Sep 17 00:00:00 2001 From: RKJ <37873142+rohit-kumar-j@users.noreply.github.com> Date: Mon, 19 Dec 2022 04:06:36 +0530 Subject: [PATCH 1/2] illegal token on right-side-of ::Windows Error without: ``` assimp\material.inl(101,47): message : error recovery skipped: ') ?' ``` Reference : https://stackoverflow.com/questions/2561368/illegal-token-on-right-side-of --- include/assimp/material.inl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/assimp/material.inl b/include/assimp/material.inl index cdf272201..0f80fdecc 100644 --- a/include/assimp/material.inl +++ b/include/assimp/material.inl @@ -98,8 +98,10 @@ AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type, return AI_FAILURE; } +#undef max +#undef min iNum = static_cast(std::min(static_cast(iNum),prop->mDataLength / sizeof(Type))); - ::memcpy(pOut,prop->mData,iNum * sizeof(Type)); + std::memcpy(pOut,prop->mData,iNum * sizeof(Type)); if (pMax) { *pMax = iNum; } From 76de8ba1f4163828c7a29efe92d326a865158b7c Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 19 Dec 2022 08:58:45 +0100 Subject: [PATCH 2/2] Update material.inl --- include/assimp/material.inl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/assimp/material.inl b/include/assimp/material.inl index 0f80fdecc..342c26646 100644 --- a/include/assimp/material.inl +++ b/include/assimp/material.inl @@ -97,9 +97,10 @@ AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type, if (prop->mType != aiPTI_Buffer) { return AI_FAILURE; } - -#undef max -#undef min +// std::min has in some cases a conflict with a defined min +#ifdef min +# undef min +#endif iNum = static_cast(std::min(static_cast(iNum),prop->mDataLength / sizeof(Type))); std::memcpy(pOut,prop->mData,iNum * sizeof(Type)); if (pMax) {