瀏覽代碼

Fix compiling issues in clang-cl

Minmin Gong 4 年之前
父節點
當前提交
c6c0f141f1
共有 3 個文件被更改,包括 10 次插入2 次删除
  1. 1 1
      code/AssetLib/AC/ACLoader.h
  2. 8 0
      include/assimp/Exceptional.h
  3. 1 1
      include/assimp/metadata.h

+ 1 - 1
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

+ 8 - 0
include/assimp/Exceptional.h

@@ -75,6 +75,10 @@ public:
     template<typename... T>
     explicit DeadlyImportError(T&&... args) :
             DeadlyErrorBase(Assimp::Formatter::format(), std::forward<T>(args)...) {}
+
+#if defined(_MSC_VER) && defined(__clang__)
+    DeadlyImportError(DeadlyImportError& other) = delete;
+#endif
 };
 
 class ASSIMP_API DeadlyExportError : public DeadlyErrorBase {
@@ -83,6 +87,10 @@ public:
     template<typename... T>
     explicit DeadlyExportError(T&&... args) :
             DeadlyErrorBase(Assimp::Formatter::format(), std::forward<T>(args)...) {}
+
+#if defined(_MSC_VER) && defined(__clang__)
+    DeadlyExportError(DeadlyExportError& other) = delete;
+#endif
 };
 
 #ifdef _MSC_VER

+ 1 - 1
include/assimp/metadata.h

@@ -351,7 +351,7 @@ struct aiMetadata {
             *static_cast<T *>(mValues[index].mData) = value;
         } else {
             if (nullptr != mValues[index].mData) {
-                delete mValues[index].mData;
+                delete static_cast<T *>(mValues[index].mData);
                 mValues[index].mData = nullptr;
             }
             mValues[index].mData = new T(value);