Browse Source

Windows: Fixed various compiler warnings and errors when building JUCE with MSVC's latest C++ 2017 support

tags/2021-05-28
hogliux 7 years ago
parent
commit
2f2ff9437b
17 changed files with 30 additions and 101 deletions
  1. +1
    -2
      modules/juce_box2d/box2d/Collision/Shapes/b2ChainShape.cpp
  2. +1
    -1
      modules/juce_box2d/box2d/Collision/Shapes/b2CircleShape.cpp
  3. +1
    -1
      modules/juce_box2d/box2d/Collision/Shapes/b2EdgeShape.cpp
  4. +0
    -1
      modules/juce_box2d/box2d/Collision/Shapes/b2PolygonShape.cpp
  5. +1
    -1
      modules/juce_box2d/box2d/Collision/b2BroadPhase.cpp
  6. +0
    -1
      modules/juce_box2d/box2d/Collision/b2Collision.h
  7. +1
    -4
      modules/juce_box2d/box2d/Common/b2BlockAllocator.cpp
  8. +0
    -5
      modules/juce_box2d/box2d/Common/b2Math.h
  9. +0
    -3
      modules/juce_box2d/box2d/Common/b2Settings.cpp
  10. +1
    -4
      modules/juce_box2d/box2d/Common/b2Settings.h
  11. +3
    -69
      modules/juce_box2d/box2d/Common/b2Timer.cpp
  12. +1
    -8
      modules/juce_box2d/box2d/Common/b2Timer.h
  13. +0
    -1
      modules/juce_box2d/box2d/Dynamics/b2Body.h
  14. +2
    -0
      modules/juce_box2d/juce_box2d.cpp
  15. +3
    -0
      modules/juce_box2d/juce_box2d.h
  16. +10
    -0
      modules/juce_core/system/juce_CompilerSupport.h
  17. +5
    -0
      modules/juce_dsp/processors/juce_WaveShaper.h

+ 1
- 2
modules/juce_box2d/box2d/Collision/Shapes/b2ChainShape.cpp View File

@@ -18,8 +18,7 @@
#include "b2ChainShape.h"
#include "b2EdgeShape.h"
#include <new>
#include <cstring>
using namespace std;
b2ChainShape::~b2ChainShape()


+ 1
- 1
modules/juce_box2d/box2d/Collision/Shapes/b2CircleShape.cpp View File

@@ -17,7 +17,7 @@
*/
#include "b2CircleShape.h"
#include <new>
using namespace std;
b2Shape* b2CircleShape::Clone(b2BlockAllocator* allocator) const


+ 1
- 1
modules/juce_box2d/box2d/Collision/Shapes/b2EdgeShape.cpp View File

@@ -17,7 +17,7 @@
*/
#include "b2EdgeShape.h"
#include <new>
using namespace std;
void b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2)


+ 0
- 1
modules/juce_box2d/box2d/Collision/Shapes/b2PolygonShape.cpp View File

@@ -17,7 +17,6 @@
*/
#include "b2PolygonShape.h"
#include <new>
b2Shape* b2PolygonShape::Clone(b2BlockAllocator* allocator) const
{


+ 1
- 1
modules/juce_box2d/box2d/Collision/b2BroadPhase.cpp View File

@@ -17,7 +17,7 @@
*/
#include "b2BroadPhase.h"
#include <cstring>
using namespace std;
b2BroadPhase::b2BroadPhase()


+ 0
- 1
modules/juce_box2d/box2d/Collision/b2Collision.h View File

@@ -20,7 +20,6 @@
#define B2_COLLISION_H
#include "../Common/b2Math.h"
#include <climits>
/// @file
/// Structures and functions used for computing contact points, distance


+ 1
- 4
modules/juce_box2d/box2d/Common/b2BlockAllocator.cpp View File

@@ -17,10 +17,7 @@
*/
#include "b2BlockAllocator.h"
#include <cstdlib>
#include <climits>
#include <cstring>
#include <memory>
using namespace std;
int32 b2BlockAllocator::s_blockSizes[b2_blockSizes] =


+ 0
- 5
modules/juce_box2d/box2d/Common/b2Math.h View File

@@ -21,11 +21,6 @@
#include "b2Settings.h"
#include <cmath>
#include <cfloat>
#include <cstddef>
#include <limits>
/// This function is used to ensure that a floating point number is
/// not a NaN or infinity.
inline bool b2IsValid(float32 x)


+ 0
- 3
modules/juce_box2d/box2d/Common/b2Settings.cpp View File

@@ -17,9 +17,6 @@
*/
#include "b2Settings.h"
#include <cstdlib>
#include <cstdio>
#include <cstdarg>
b2Version b2_version = {2, 2, 1};


+ 1
- 4
modules/juce_box2d/box2d/Common/b2Settings.h View File

@@ -19,11 +19,8 @@
#ifndef B2_SETTINGS_H
#define B2_SETTINGS_H
#include <cassert>
#include <cmath>
#define B2_NOT_USED(x) ((void)(x))
#define b2Assert(A) assert(A)
#define b2Assert(A) jassert(A)
typedef float float32;
typedef double float64;


+ 3
- 69
modules/juce_box2d/box2d/Common/b2Timer.cpp View File

@@ -18,83 +18,17 @@
#include "b2Timer.h"
#if defined(_WIN32)
float64 b2Timer::s_invFrequency = 0.0f;
#include <windows.h>
b2Timer::b2Timer()
{
LARGE_INTEGER largeInteger;
if (s_invFrequency == 0.0f)
{
QueryPerformanceFrequency(&largeInteger);
s_invFrequency = float64(largeInteger.QuadPart);
if (s_invFrequency > 0.0f)
{
s_invFrequency = 1000.0f / s_invFrequency;
}
}
QueryPerformanceCounter(&largeInteger);
m_start = float64(largeInteger.QuadPart);
}
void b2Timer::Reset()
{
LARGE_INTEGER largeInteger;
QueryPerformanceCounter(&largeInteger);
m_start = float64(largeInteger.QuadPart);
}
float32 b2Timer::GetMilliseconds() const
{
LARGE_INTEGER largeInteger;
QueryPerformanceCounter(&largeInteger);
float64 count = float64(largeInteger.QuadPart);
float32 ms = float32(s_invFrequency * (count - m_start));
return ms;
}
#elif defined(__linux__) || defined (__APPLE__)
#include <sys/time.h>
b2Timer::b2Timer()
b2Timer::b2Timer()
{
Reset();
}
void b2Timer::Reset()
{
timeval t;
gettimeofday(&t, 0);
m_start_sec = t.tv_sec;
m_start_msec = t.tv_usec * 0.001f;
juceStartTime = juce::Time::getCurrentTime();
}
float32 b2Timer::GetMilliseconds() const
{
timeval t;
gettimeofday(&t, 0);
return (t.tv_sec - m_start_sec) * 1000 + t.tv_usec * 0.001f - m_start_msec;
}
#else
b2Timer::b2Timer()
{
return static_cast<float32> ((juce::Time::getCurrentTime() - juceStartTime).inMilliseconds());
}
void b2Timer::Reset()
{
}
float32 b2Timer::GetMilliseconds() const
{
return 0.0f;
}
#endif

+ 1
- 8
modules/juce_box2d/box2d/Common/b2Timer.h View File

@@ -37,14 +37,7 @@ public:
float32 GetMilliseconds() const;
private:
#if defined(_WIN32)
float64 m_start;
static float64 s_invFrequency;
#elif defined(__linux__) || defined (__APPLE__)
unsigned long m_start_sec;
unsigned long m_start_msec;
#endif
juce::Time juceStartTime;
};
#endif

+ 0
- 1
modules/juce_box2d/box2d/Dynamics/b2Body.h View File

@@ -21,7 +21,6 @@
#include "../Common/b2Math.h"
#include "../Collision/Shapes/b2Shape.h"
#include <memory>
class b2Fixture;
class b2Joint;


+ 2
- 0
modules/juce_box2d/juce_box2d.cpp View File

@@ -45,6 +45,8 @@
#include "juce_box2d.h"
#include <cstdarg>
typedef juce::int8 int8;
typedef juce::int16 int16;
typedef juce::int32 int32;


+ 3
- 0
modules/juce_box2d/juce_box2d.h View File

@@ -59,6 +59,9 @@
#pragma GCC diagnostic ignored "-Wconversion"
#endif
#include <climits>
#include <cfloat>
#include "box2d/Box2D.h"
#ifdef __GNUC__


+ 10
- 0
modules/juce_core/system/juce_CompilerSupport.h View File

@@ -51,6 +51,10 @@
#define JUCE_EXCEPTIONS_DISABLED 1
#endif
#endif
#define JUCE_CXX14_IS_AVAILABLE (__cplusplus >= 201402L)
#define JUCE_CXX17_IS_AVAILABLE (__cplusplus >= 201703L)
#endif
//==============================================================================
@@ -79,6 +83,9 @@
#endif
#endif
#define JUCE_CXX14_IS_AVAILABLE (__cplusplus >= 201402L)
#define JUCE_CXX17_IS_AVAILABLE (__cplusplus >= 201703L)
#endif
//==============================================================================
@@ -106,6 +113,9 @@
#define JUCE_EXCEPTIONS_DISABLED 1
#endif
#endif
#define JUCE_CXX14_IS_AVAILABLE (_MSVC_LANG >= 201402L)
#define JUCE_CXX17_IS_AVAILABLE (_MSVC_LANG >= 201703L)
#endif
//==============================================================================


+ 5
- 0
modules/juce_dsp/processors/juce_WaveShaper.h View File

@@ -72,8 +72,13 @@ struct WaveShaper
};
//==============================================================================
#if JUCE_CXX17_IS_AVAILABLE
template <typename Functor>
static WaveShaper<typename std::invoke_result<Functor>, Functor> CreateWaveShaper (Functor functionToUse) { return {functionToUse}; }
#else
template <typename Functor>
static WaveShaper<typename std::result_of<Functor>, Functor> CreateWaveShaper (Functor functionToUse) { return {functionToUse}; }
#endif
} // namespace dsp
} // namespace juce

Loading…
Cancel
Save