Răsfoiți Sursa

ix compiler warning for pragma statements.

Kim Kulling 5 ani în urmă
părinte
comite
976091a6f6

+ 3 - 1
code/3DS/3DSHelper.h

@@ -321,7 +321,9 @@ public:
 struct Face : public FaceWithSmoothingGroup {
 struct Face : public FaceWithSmoothingGroup {
 };
 };
 
 
-#pragma warning(disable : 4315)
+#ifdef _WIN32
+#    pragma warning(disable : 4315)
+#endif
 
 
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 /** Helper structure representing a texture */
 /** Helper structure representing a texture */

+ 9 - 5
code/Assbin/AssbinFileWriter.cpp

@@ -54,15 +54,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <assimp/IOStream.hpp>
 #include <assimp/IOStream.hpp>
 
 
 #ifdef ASSIMP_BUILD_NO_OWN_ZLIB
 #ifdef ASSIMP_BUILD_NO_OWN_ZLIB
-#include <zlib.h>
+#    include <zlib.h>
 #else
 #else
-#include "../contrib/zlib/zlib.h"
+#    include "../contrib/zlib/zlib.h"
 #endif
 #endif
 
 
 #include <time.h>
 #include <time.h>
 
 
-#pragma warning(push)
-#pragma warning(disable : 4706)
+#ifdef _WIN32
+#    pragma warning(push)
+#    pragma warning(disable : 4706)
+#endif // _WIN32
 
 
 namespace Assimp {
 namespace Assimp {
 
 
@@ -824,6 +826,8 @@ void DumpSceneToAssbin(
     AssbinFileWriter fileWriter(shortened, compressed);
     AssbinFileWriter fileWriter(shortened, compressed);
     fileWriter.WriteBinaryDump(pFile, cmd, pIOSystem, pScene);
     fileWriter.WriteBinaryDump(pFile, cmd, pIOSystem, pScene);
 }
 }
-#pragma warning(pop)
+#ifdef _WIN32
+#    pragma warning(pop)
+#endif // _WIN32
 
 
 } // end of namespace Assimp
 } // end of namespace Assimp

+ 3 - 1
code/Common/SpatialSort.cpp

@@ -53,7 +53,9 @@ using namespace Assimp;
 #   define CHAR_BIT 8
 #   define CHAR_BIT 8
 #endif
 #endif
 
 
-#pragma warning(disable : 4127)  
+#ifdef _WIN32
+#    pragma warning(disable : 4127)  
+#endif // _WIN32
 
 
 // ------------------------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------------------------
 // Constructs a spatially sorted representation from the given position array.
 // Constructs a spatially sorted representation from the given position array.

+ 7 - 3
code/M3D/m3d.h

@@ -99,8 +99,10 @@ typedef uint16_t M3D_INDEX;
 #define _register
 #define _register
 #endif
 #endif
 
 
-#pragma warning(push)
-#pragma warning(disable : 4127 5573 4505 4244 4403 5744 4701 4703)
+#ifdef _WIN32
+#    pragma warning(push)
+#    pragma warning(disable : 4127 5573 4505 4244 4403 5744 4701 4703)
+#endif // _WIN32
 
 
 /*** File format structures ***/
 /*** File format structures ***/
 
 
@@ -6134,7 +6136,9 @@ public:
 #endif /* impl */
 #endif /* impl */
 } // namespace M3D
 } // namespace M3D
 
 
-#pragma warning(pop <)
+#ifdef _WIN32
+#    pragma warning(pop)
+#endif // _WIN32
 
 
 #endif
 #endif
 
 

+ 1 - 1
code/PostProcessing/ArmaturePopulate.cpp

@@ -164,7 +164,7 @@ void ArmaturePopulate::BuildNodeList(const aiNode *current_node,
 // duplicate names :)
 // duplicate names :)
 void ArmaturePopulate::BuildBoneStack(aiNode *,
 void ArmaturePopulate::BuildBoneStack(aiNode *,
                                       const aiNode *root_node,
                                       const aiNode *root_node,
-                                      const aiScene *scene,
+                                      const aiScene*,
                                       const std::vector<aiBone *> &bones,
                                       const std::vector<aiBone *> &bones,
                                       std::map<aiBone *, aiNode *> &bone_stack,
                                       std::map<aiBone *, aiNode *> &bone_stack,
                                   std::vector<aiNode *> &node_stack) {
                                   std::vector<aiNode *> &node_stack) {

+ 7 - 3
code/glTF/glTFAsset.inl

@@ -57,8 +57,10 @@ namespace glTF {
 
 
 namespace {
 namespace {
 
 
-#pragma warning(push)
-#pragma warning(disable : 4706)
+#ifdef _WIN32
+#    pragma warning(push)
+#    pragma warning(disable : 4706)
+#endif // _WIN32
 
 
 //
 //
 // JSON Value reading helpers
 // JSON Value reading helpers
@@ -1410,6 +1412,8 @@ inline std::string Asset::FindUniqueID(const std::string &str, const char *suffi
     return id;
     return id;
 }
 }
 
 
-#pragma warning(pop)
+#ifdef _WIN32
+#    pragma warning(pop)
+#endif // WIN32
 
 
 } // namespace glTF
 } // namespace glTF

+ 7 - 3
code/glTF/glTFAssetWriter.inl

@@ -43,8 +43,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <rapidjson/writer.h>
 #include <rapidjson/writer.h>
 #include <rapidjson/prettywriter.h>
 #include <rapidjson/prettywriter.h>
 
 
-#pragma warning(push)
-#pragma warning( disable : 4706)
+#ifdef _WIN32
+#    pragma warning(push)
+#    pragma warning( disable : 4706)
+#endif // _WIN32
 
 
 namespace glTF {
 namespace glTF {
 
 
@@ -701,6 +703,8 @@ namespace glTF {
         w.WriteObjects(d);
         w.WriteObjects(d);
     }
     }
 
 
-#pragma warning(pop)
+#ifdef _WIN32
+#    pragma warning(pop)
+#endif // _WIN32
 
 
 }
 }

+ 8 - 3
code/glTF/glTFCommon.h

@@ -189,8 +189,11 @@ inline void CopyValue(const glTFCommon::mat4 &v, aiMatrix4x4 &o) {
     o.d4 = v[15];
     o.d4 = v[15];
 }
 }
 
 
-#pragma warning(push)
-#pragma warning(disable : 4310)
+#ifdef _WIN32
+#    pragma warning(push)
+#    pragma warning(disable : 4310)
+#endif // _WIN32
+
 inline std::string getCurrentAssetDir(const std::string &pFile) {
 inline std::string getCurrentAssetDir(const std::string &pFile) {
     std::string path = pFile;
     std::string path = pFile;
     int pos = std::max(int(pFile.rfind('/')), int(pFile.rfind('\\')));
     int pos = std::max(int(pFile.rfind('/')), int(pFile.rfind('\\')));
@@ -200,7 +203,9 @@ inline std::string getCurrentAssetDir(const std::string &pFile) {
 
 
     return path;
     return path;
 }
 }
-#pragma warning(pop)
+#ifdef _WIN32
+#    pragma warning(pop)
+#endif // _WIN32
 
 
 namespace Util {
 namespace Util {
 
 

+ 10 - 4
code/glTF2/glTF2Asset.inl

@@ -901,8 +901,11 @@ inline int Compare(const char *attr, const char (&str)[N]) {
     return (strncmp(attr, str, N - 1) == 0) ? N - 1 : 0;
     return (strncmp(attr, str, N - 1) == 0) ? N - 1 : 0;
 }
 }
 
 
-#pragma warning(push)
-#pragma warning(disable : 4706)
+#ifdef _WIN32
+#    pragma warning(push)
+#    pragma warning(disable : 4706)
+#endif // _WIN32
+
 inline bool GetAttribVector(Mesh::Primitive &p, const char *attr, Mesh::AccessorList *&v, int &pos) {
 inline bool GetAttribVector(Mesh::Primitive &p, const char *attr, Mesh::AccessorList *&v, int &pos) {
     if ((pos = Compare(attr, "POSITION"))) {
     if ((pos = Compare(attr, "POSITION"))) {
         v = &(p.attributes.position);
         v = &(p.attributes.position);
@@ -1504,8 +1507,9 @@ inline std::string Asset::FindUniqueID(const std::string &str, const char *suffi
     id += suffix;
     id += suffix;
 
 
     Asset::IdMap::iterator it = mUsedIds.find(id);
     Asset::IdMap::iterator it = mUsedIds.find(id);
-    if (it == mUsedIds.end())
+    if (it == mUsedIds.end()) {
         return id;
         return id;
+    }
 
 
     std::vector<char> buffer;
     std::vector<char> buffer;
     buffer.resize(id.size() + 16);
     buffer.resize(id.size() + 16);
@@ -1519,6 +1523,8 @@ inline std::string Asset::FindUniqueID(const std::string &str, const char *suffi
     return id;
     return id;
 }
 }
 
 
-#pragma warning(pop)
+#ifdef _WIN32
+#    pragma warning(pop)
+#endif // _WIN32
 
 
 } // namespace glTF2
 } // namespace glTF2

+ 7 - 3
contrib/Open3DGC/o3dgcSC3DMCDecoder.inl

@@ -27,8 +27,10 @@ THE SOFTWARE.
 #include "o3dgcArithmeticCodec.h"
 #include "o3dgcArithmeticCodec.h"
 #include "o3dgcTimer.h"
 #include "o3dgcTimer.h"
 
 
-#pragma warning(push)
-#pragma warning( disable : 4456)
+#ifdef _WIN32
+#    pragma warning(push)
+#    pragma warning( disable : 4456)
+#endif // _WIN32
 
 
 //#define DEBUG_VERBOSE
 //#define DEBUG_VERBOSE
 
 
@@ -847,7 +849,9 @@ namespace o3dgc
     }
     }
 } // namespace o3dgc
 } // namespace o3dgc
 
 
-#pragma warning( pop )
+#ifdef _WIN32
+#    pragma warning( pop )
+#endif // _WIN32
 
 
 #endif // O3DGC_SC3DMC_DECODER_INL
 #endif // O3DGC_SC3DMC_DECODER_INL
 
 

+ 7 - 3
contrib/Open3DGC/o3dgcSC3DMCEncoder.inl

@@ -32,8 +32,10 @@ THE SOFTWARE.
 
 
 //#define DEBUG_VERBOSE
 //#define DEBUG_VERBOSE
 
 
-#pragma warning(push)
-#pragma warning(disable : 4456)
+#ifdef _WIN32
+#    pragma warning(push)
+#    pragma warning(disable : 4456)
+#endif // _WIN32
 
 
 namespace o3dgc
 namespace o3dgc
 {
 {
@@ -925,7 +927,9 @@ namespace o3dgc
     }
     }
 } // namespace o3dgc
 } // namespace o3dgc
 
 
-#pragma warning(pop)
+#ifdef _WIN32
+#    pragma warning(pop)
+#endif // _WIN32
 
 
 #endif // O3DGC_SC3DMC_ENCODER_INL
 #endif // O3DGC_SC3DMC_ENCODER_INL
 
 

+ 8 - 3
contrib/poly2tri/poly2tri/sweep/sweep.cc

@@ -36,8 +36,11 @@
 
 
 namespace p2t {
 namespace p2t {
 
 
-#pragma warning(push)
-#pragma warning( disable : 4702 )
+#ifdef _WIN32
+#    pragma warning(push)
+#    pragma warning( disable : 4702 )
+#endif // _WIN32
+
 // Triangulate simple polygon with holes
 // Triangulate simple polygon with holes
 void Sweep::Triangulate(SweepContext& tcx)
 void Sweep::Triangulate(SweepContext& tcx)
 {
 {
@@ -797,6 +800,8 @@ Sweep::~Sweep() {
 
 
 }
 }
 
 
-#pragma warning( pop )
+#ifdef _WIN32
+#    pragma warning( pop )
+#endif // _WIN32
 
 
 }
 }

+ 7 - 5
contrib/unzip/ioapi.c

@@ -13,10 +13,10 @@
 #include "zlib.h"
 #include "zlib.h"
 #include "ioapi.h"
 #include "ioapi.h"
 
 
-#pragma warning(push)
-#pragma warning(disable : 4131 4100)
-
-
+#ifdef _WIN32
+#    pragma warning(push)
+#    pragma warning(disable : 4131 4100)
+#endif // _WIN32
 
 
 /* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
 /* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
 
 
@@ -179,4 +179,6 @@ void fill_fopen_filefunc (pzlib_filefunc_def)
     pzlib_filefunc_def->opaque = NULL;
     pzlib_filefunc_def->opaque = NULL;
 }
 }
 
 
-#pragma warning(pop)
+#ifdef _WIN32
+#    pragma warning(pop)
+#endif // _WIN32

+ 7 - 4
contrib/unzip/unzip.c

@@ -89,9 +89,10 @@ typedef unsigned long z_crc_t;
 #define SIZEZIPLOCALHEADER (0x1e)
 #define SIZEZIPLOCALHEADER (0x1e)
 
 
 
 
-#pragma warning(push)
-#pragma warning(disable : 4131 4244 4189 4245)
-
+#ifdef _WIN32
+#    pragma warning(push)
+#    pragma warning(disable : 4131 4244 4189 4245)
+#endif // _WIN32
 
 
 const char unz_copyright[] =
 const char unz_copyright[] =
    " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
    " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
@@ -1616,4 +1617,6 @@ extern int ZEXPORT unzSetOffset (file, pos)
     return err;
     return err;
 }
 }
 
 
-#pragma warning(pop)
+#ifdef _WIN32
+#    pragma warning(pop)
+#endif // _WIN32