Skip to content

Commit

Permalink
mingw: pragma warnings are msvc and not win specific
Browse files Browse the repository at this point in the history
This significantly cuts down on warnings when cross building.

Signed-off-by: Ralph Sennhauser <[email protected]>
  • Loading branch information
seragh committed Sep 1, 2024
1 parent 5319a75 commit 4612cc8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
8 changes: 4 additions & 4 deletions FCollada/FMath/FMArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

#include <type_traits>

#ifdef _WIN32
#ifdef _MSC_VER
#pragma warning(disable:4127)
#endif //_WIN32
#endif //_MSC_VER

/** Namespace that contains the overwritten STL classes. */
namespace fm
Expand Down Expand Up @@ -655,7 +655,7 @@ inline bool IsEquivalent(const T* al, size_t acount, const T* bl, size_t bcount)
return equivalent;
}

#ifdef _WIN32
#ifdef _MSC_VER
#pragma warning(default:4127)
#endif //_WIN32
#endif // _MSC_VER
#endif // _FM_ARRAY_H_
4 changes: 2 additions & 2 deletions FCollada/FUtils/FUParameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

/** @defgroup FUParameter The generic FCollada parameter interface. */

#ifdef _WIN32
#ifdef _MSC_VER
#pragma warning(disable:4355) // 'this' : used in base member initializer list.
#endif // _WIN32
#endif // _MSC_VER

/** Contains the supported qualifiers for parameter types. */
namespace FUParameterQualifiers
Expand Down
9 changes: 6 additions & 3 deletions FCollada/FUtils/FUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE 1 // MSVS 2005 support.
#endif // _CRT_SECURE_NO_DEPRECATE
#pragma warning(disable:4702)
#endif // _WIN32

#ifdef _MSC_VER
#pragma warning(disable:4702)
#endif // _MSC_VER

#define NOMINMAX /**< Rid us of the default versions of MINMAX. */
#ifdef max
#undef max
Expand All @@ -55,9 +58,9 @@ template <class T>
inline const T& min(const T& x,const T& y) { return (x < y) ? x : y; } /**< See above. */
#endif // FCOLLADA_NOMINMAX

#ifdef _WIN32
#ifdef _MSC_VER
#pragma warning(default:4702)
#endif
#endif // _MSC_VER

// Conversion macros
#define UNUSED(a) /**< Removes a piece of code during the pre-process. This macro is useful for these pesky unused variable warnings. */
Expand Down
8 changes: 4 additions & 4 deletions FCollada/FUtils/Platforms.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@

#include "fcollada_export.h"

#ifdef _WIN32
#ifdef _MSC_VER
// Disable the "private member not available for export" warning,
// because I don't feel like writing interfaces
#pragma warning(disable:4251)
#endif // _WIN32

#pragma warning(disable:4702)
#endif // _MSC_VER

#ifdef __PPU__
#define UNICODE
Expand All @@ -41,8 +43,6 @@
#include <cmath>

#ifdef _WIN32

#pragma warning(disable:4702)
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
Expand Down

0 comments on commit 4612cc8

Please sign in to comment.