Fixed Linux compilation complaining about min() and max(), hopefully forever. Use std::min() and std::max()
git-svn-id: http://mc-server.googlecode.com/svn/trunk@539 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
39a59d6806
commit
018d941daf
@ -89,6 +89,10 @@ typedef short Int16;
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
|
|
||||||
|
// Windows SDK defines min and max macros, messing up with our std::min and std::max usage
|
||||||
|
#undef min
|
||||||
|
#undef max
|
||||||
#else
|
#else
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h> // for mkdir
|
#include <sys/stat.h> // for mkdir
|
||||||
@ -176,6 +180,7 @@ typedef short Int16;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// A generic interface used mainly in ForEach() functions
|
/// A generic interface used mainly in ForEach() functions
|
||||||
template <typename Type> class cItemCallback
|
template <typename Type> class cItemCallback
|
||||||
{
|
{
|
||||||
|
@ -288,7 +288,7 @@ HEIGHTTYPE cHeiGenBiomal::GetHeightAt(int a_RelX, int a_RelZ, int a_ChunkX, int
|
|||||||
Height += BiomeCounts[i] * (int)(m_GenParam[i].m_BaseHeight + oct1 + oct2 + oct3);
|
Height += BiomeCounts[i] * (int)(m_GenParam[i].m_BaseHeight + oct1 + oct2 + oct3);
|
||||||
}
|
}
|
||||||
int res = (HEIGHTTYPE)(Height / Sum);
|
int res = (HEIGHTTYPE)(Height / Sum);
|
||||||
return min(250, max(res, 5));
|
return std::min(250, std::max(res, 5));
|
||||||
}
|
}
|
||||||
|
|
||||||
// No known biome around? Weird. Return a bogus value:
|
// No known biome around? Weird. Return a bogus value:
|
||||||
|
@ -11,14 +11,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef min
|
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int x, z;
|
int x, z;
|
||||||
@ -454,7 +446,7 @@ void GetPineTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Noise
|
|||||||
// LOGD("Generating %d layers of pine leaves, SameSizeMax = %d", NumLeavesLayers, SameSizeMax);
|
// LOGD("Generating %d layers of pine leaves, SameSizeMax = %d", NumLeavesLayers, SameSizeMax);
|
||||||
for (int i = 0; i < NumLeavesLayers; ++i)
|
for (int i = 0; i < NumLeavesLayers; ++i)
|
||||||
{
|
{
|
||||||
int LayerSize = min(i, NumLeavesLayers - i + SameSizeMax - 1);
|
int LayerSize = std::min(i, NumLeavesLayers - i + SameSizeMax - 1);
|
||||||
// LOGD("LayerSize %d: %d", i, LayerSize);
|
// LOGD("LayerSize %d: %d", i, LayerSize);
|
||||||
if (LayerSize < 0)
|
if (LayerSize < 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user