From c6c0f141f1ff6d4d20da8c830b1d954407bc1c0a Mon Sep 17 00:00:00 2001 From: Minmin Gong Date: Wed, 3 Mar 2021 22:30:36 -0800 Subject: [PATCH 1/4] Fix compiling issues in clang-cl --- code/AssetLib/AC/ACLoader.h | 2 +- include/assimp/Exceptional.h | 8 ++++++++ include/assimp/metadata.h | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/AC/ACLoader.h b/code/AssetLib/AC/ACLoader.h index 5167394eb..77de16b8b 100644 --- a/code/AssetLib/AC/ACLoader.h +++ b/code/AssetLib/AC/ACLoader.h @@ -116,7 +116,7 @@ public: Mask = 0xf, }; - inline const uint8_t GetType() const { return (flags & Mask); } + inline uint8_t GetType() const { return (flags & Mask); } }; // Represents an AC3D object diff --git a/include/assimp/Exceptional.h b/include/assimp/Exceptional.h index dab681b23..36d60d63a 100644 --- a/include/assimp/Exceptional.h +++ b/include/assimp/Exceptional.h @@ -75,6 +75,10 @@ public: template explicit DeadlyImportError(T&&... args) : DeadlyErrorBase(Assimp::Formatter::format(), std::forward(args)...) {} + +#if defined(_MSC_VER) && defined(__clang__) + DeadlyImportError(DeadlyImportError& other) = delete; +#endif }; class ASSIMP_API DeadlyExportError : public DeadlyErrorBase { @@ -83,6 +87,10 @@ public: template explicit DeadlyExportError(T&&... args) : DeadlyErrorBase(Assimp::Formatter::format(), std::forward(args)...) {} + +#if defined(_MSC_VER) && defined(__clang__) + DeadlyExportError(DeadlyExportError& other) = delete; +#endif }; #ifdef _MSC_VER diff --git a/include/assimp/metadata.h b/include/assimp/metadata.h index 2f8421c1c..fdc88be56 100644 --- a/include/assimp/metadata.h +++ b/include/assimp/metadata.h @@ -351,7 +351,7 @@ struct aiMetadata { *static_cast(mValues[index].mData) = value; } else { if (nullptr != mValues[index].mData) { - delete mValues[index].mData; + delete static_cast(mValues[index].mData); mValues[index].mData = nullptr; } mValues[index].mData = new T(value); From 2576c8c3a6a5229f7dc99125be8f1b6fad66e7ce Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 4 Mar 2021 08:04:19 +0100 Subject: [PATCH 2/4] Compile fix for MSVC 2019 Small is seen as a type with some options so this fixes the errors starting with: code\PostProcessing\ComputeUVMappingProcess.cpp(125): error C2632: 'int' followed by 'char' is illegal --- code/PostProcessing/ComputeUVMappingProcess.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/PostProcessing/ComputeUVMappingProcess.cpp b/code/PostProcessing/ComputeUVMappingProcess.cpp index b722e44f1..8ce3e41c4 100644 --- a/code/PostProcessing/ComputeUVMappingProcess.cpp +++ b/code/PostProcessing/ComputeUVMappingProcess.cpp @@ -122,7 +122,7 @@ void RemoveUVSeams (aiMesh* mesh, aiVector3D* out) const aiFace& face = mesh->mFaces[fidx]; if (face.mNumIndices < 3) continue; // triangles and polygons only, please - unsigned int small = face.mNumIndices, large = small; + unsigned int smallV = face.mNumIndices, large = smallV; bool zero = false, one = false, round_to_zero = false; // Check whether this face lies on a UV seam. We can just guess, @@ -133,7 +133,7 @@ void RemoveUVSeams (aiMesh* mesh, aiVector3D* out) { if (out[face.mIndices[n]].x < LOWER_LIMIT) { - small = n; + smallV = n; // If we have a U value very close to 0 we can't // round the others to 0, too. @@ -151,7 +151,7 @@ void RemoveUVSeams (aiMesh* mesh, aiVector3D* out) one = true; } } - if (small != face.mNumIndices && large != face.mNumIndices) + if (smallV != face.mNumIndices && large != face.mNumIndices) { for (unsigned int n = 0; n < face.mNumIndices;++n) { From dffaeade94b9688f2047aee01c8244ba446d5f2f Mon Sep 17 00:00:00 2001 From: Paul Engelhardt <1paulEngelhardt@gmail.com> Date: Mon, 8 Mar 2021 09:04:22 +0100 Subject: [PATCH 3/4] Update crypt.c --- contrib/unzip/crypt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/unzip/crypt.c b/contrib/unzip/crypt.c index c3cc5d991..299ce03d2 100644 --- a/contrib/unzip/crypt.c +++ b/contrib/unzip/crypt.c @@ -21,6 +21,10 @@ NOCRYPT and NOUNCRYPT. */ +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) + #define MICROSOFT_WINDOWS_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS 0 +#endif + #include #include #include From e53335e58c8049496a630fe46c91413390d45aea Mon Sep 17 00:00:00 2001 From: jaefunk Date: Tue, 9 Mar 2021 18:31:15 +0900 Subject: [PATCH 4/4] change file encoding --- contrib/gtest/include/gtest/internal/gtest-internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/gtest/include/gtest/internal/gtest-internal.h b/contrib/gtest/include/gtest/internal/gtest-internal.h index ebd1cf615..e66c74841 100644 --- a/contrib/gtest/include/gtest/internal/gtest-internal.h +++ b/contrib/gtest/include/gtest/internal/gtest-internal.h @@ -1,4 +1,4 @@ -// Copyright 2005, Google Inc. +// Copyright 2005, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without