From 50c0447808f7041d5af5017c847a462e9599bdb5 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 4 Oct 2011 13:26:54 -0700 Subject: disabled min and max windows macros another attempt at fixing gcc builds --- indra/llcommon/llapr.h | 3 +++ indra/llcommon/llprocesslauncher.h | 1 + indra/llrender/llglheaders.h | 1 + indra/llui/llui.h | 33 ++++++++++++++++----------------- indra/llwindow/lldragdropwin32.h | 2 ++ indra/llwindow/llwindowwin32.h | 1 + indra/win_crash_logger/StdAfx.h | 2 +- 7 files changed, 25 insertions(+), 18 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h index 3f846f1314..286fc43a77 100644 --- a/indra/llcommon/llapr.h +++ b/indra/llcommon/llapr.h @@ -37,6 +37,9 @@ // If you get undefined symbols, find the appropriate // Windows header file and include that in your .cpp file. #define WIN32_LEAN_AND_MEAN + // do not define min() and max() macros, which collide with + // things like numeric_limits + #define NOMINMAX #include #include #endif diff --git a/indra/llcommon/llprocesslauncher.h b/indra/llcommon/llprocesslauncher.h index 954c249147..23e48b1823 100644 --- a/indra/llcommon/llprocesslauncher.h +++ b/indra/llcommon/llprocesslauncher.h @@ -28,6 +28,7 @@ #define LL_LLPROCESSLAUNCHER_H #if LL_WINDOWS +#define NOMINMAX #include #endif diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index 851a75629e..b936fd30f8 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -520,6 +520,7 @@ extern PFNGLSAMPLEMASKIPROC glSampleMaski; // windows gl headers depend on things like APIENTRY, so include windows. #define WIN32_LEAN_AND_MEAN +#define NOMINMAX #include #include diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 8cec1a16f4..af8f239657 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -41,6 +41,7 @@ #include #include "lllazyvalue.h" #include "llframetimer.h" +#include // LLUIFactory #include "llsd.h" @@ -150,27 +151,25 @@ public: // // Classes // + template + struct RangeParams : public LLInitParam::Block > + { + Optional minimum, + maximum; + + RangeParams() + : minimum("min", T()), + maximum("max", std::numeric_limits::max()) + {} + }; template struct Range { typedef Range self_t; - struct Params : public LLInitParam::Block - { - typename Optional minimum, - maximum; - - Params() - : minimum("min", 0), - maximum("max", S32_MAX) - { - - } - }; - // correct for inverted params - Range(const Params& p = Params()) + Range(const RangeParams& p = RangeParams()) : mMin(p.minimum), mMax(p.maximum) { @@ -228,12 +227,12 @@ public: { typedef Range range_t; - struct Params : public LLInitParam::Block + struct Params : public LLInitParam::Block > { - Mandatory value; + Mandatory value; Params() - : value("", 0) + : value("", T()) { addSynonym(value, "value"); } diff --git a/indra/llwindow/lldragdropwin32.h b/indra/llwindow/lldragdropwin32.h index 929e7f9e37..63054bffec 100644 --- a/indra/llwindow/lldragdropwin32.h +++ b/indra/llwindow/lldragdropwin32.h @@ -31,6 +31,7 @@ #ifndef LL_LLDRAGDROP32_H #define LL_LLDRAGDROP32_H +#define NOMINMAX #include #include @@ -54,6 +55,7 @@ class LLDragDropWin32 #ifndef LL_LLDRAGDROP32_H #define LL_LLDRAGDROP32_H +#define NOMINMAX #include #include diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 387e4cbdb6..dc1950fb31 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -29,6 +29,7 @@ // Limit Windows API to small and manageable set. #define WIN32_LEAN_AND_MEAN +#define NOMINMAX #include #include diff --git a/indra/win_crash_logger/StdAfx.h b/indra/win_crash_logger/StdAfx.h index ce70fe2994..71faf88bad 100644 --- a/indra/win_crash_logger/StdAfx.h +++ b/indra/win_crash_logger/StdAfx.h @@ -37,7 +37,7 @@ #endif // _MSC_VER > 1000 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - +#define NOMINMAX // don't define min and max macros // Windows Header Files: #include -- cgit v1.2.3