From 150514fc8bd5203e4bf4aef8915cec554526d97a Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Wed, 27 Jan 2021 10:42:28 +0000 Subject: [PATCH] Move draco warning suppression Should be around the include for portability, not template instantiation Fix clang pragma typos --- code/AssetLib/glTF2/glTF2Asset.inl | 45 +++++++++++++++--------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Asset.inl b/code/AssetLib/glTF2/glTF2Asset.inl index 90e50d733..7ca6913c6 100644 --- a/code/AssetLib/glTF2/glTF2Asset.inl +++ b/code/AssetLib/glTF2/glTF2Asset.inl @@ -47,8 +47,31 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #ifdef ASSIMP_ENABLE_DRACO + +// Google draco library headers spew many warnings. Bad Google, no cookie +#if _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4018) // Signed/unsigned mismatch +#pragma warning(disable : 4804) // Unsafe use of type 'bool' +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wsign-compare" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wbool-compare" +#pragma GCC diagnostic ignored "-Wsign-compare" +#endif + #include "draco/compression/decode.h" #include "draco/core/decoder_buffer.h" + +#if _MSC_VER +#pragma warning(pop) +#elif defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#endif #ifndef DRACO_MESH_COMPRESSION_SUPPORTED #error glTF: KHR_draco_mesh_compression: draco library must have DRACO_MESH_COMPRESSION_SUPPORTED #endif @@ -193,20 +216,6 @@ inline Value *FindExtension(Value &val, const char *extensionId) { } // namespace #ifdef ASSIMP_ENABLE_DRACO -// Google draco library headers spew many warnings. Bad Google, no cookie -#if _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4018) // Signed/unsigned mismatch -#pragma warning(disable : 4804) // Unsafe use of type 'bool' -#elif defined(__clang__) -#pragma diagnostic push -#pragma clang diagnostic ignored "-Wbool-compare" -#pragma clang diagnostic ignored "-Wsign-compare" -#elif defined(__GNUC__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wbool-compare" -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif template inline void CopyFaceIndex_Draco(Buffer &decodedIndexBuffer, const draco::Mesh &draco_mesh) { @@ -289,14 +298,6 @@ inline void SetDecodedAttributeBuffer_Draco(const draco::Mesh &dracoMesh, uint32 accessor.decodedBuffer.swap(decodedAttribBuffer); } -#if _MSC_VER -#pragma warning(pop) -#elif defined(__clang__) -#pragma diagnostic pop -#elif defined(__GNUC__) -#pragma GCC diagnostic pop -#endif - #endif // ASSIMP_ENABLE_DRACO //