diff options
-rw-r--r-- | indra/llcommon/llapr.h | 3 | ||||
-rw-r--r-- | indra/llcommon/llprocesslauncher.h | 1 | ||||
-rw-r--r-- | indra/llrender/llglheaders.h | 1 | ||||
-rw-r--r-- | indra/llui/llui.h | 33 | ||||
-rw-r--r-- | indra/llwindow/lldragdropwin32.h | 2 | ||||
-rw-r--r-- | indra/llwindow/llwindowwin32.h | 1 | ||||
-rw-r--r-- | indra/win_crash_logger/StdAfx.h | 2 |
7 files changed, 25 insertions, 18 deletions
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<T> + #define NOMINMAX #include <winsock2.h> #include <windows.h> #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 <windows.h> #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 <winsock2.h> #include <windows.h> 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 <boost/signals2.hpp> #include "lllazyvalue.h" #include "llframetimer.h" +#include <limits> // LLUIFactory #include "llsd.h" @@ -150,27 +151,25 @@ public: // // Classes // + template <typename T> + struct RangeParams : public LLInitParam::Block<RangeParams<T> > + { + Optional<T> minimum, + maximum; + + RangeParams() + : minimum("min", T()), + maximum("max", std::numeric_limits<T>::max()) + {} + }; template <typename T> struct Range { typedef Range<T> self_t; - struct Params : public LLInitParam::Block<Params> - { - typename Optional<T> minimum, - maximum; - - Params() - : minimum("min", 0), - maximum("max", S32_MAX) - { - - } - }; - // correct for inverted params - Range(const Params& p = Params()) + Range(const RangeParams<T>& p = RangeParams<T>()) : mMin(p.minimum), mMax(p.maximum) { @@ -228,12 +227,12 @@ public: { typedef Range<T> range_t; - struct Params : public LLInitParam::Block<Params, typename range_t::Params> + struct Params : public LLInitParam::Block<Params, RangeParams<T> > { - Mandatory<S32> value; + Mandatory<T> 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 <windows.h> #include <ole2.h> @@ -54,6 +55,7 @@ class LLDragDropWin32 #ifndef LL_LLDRAGDROP32_H #define LL_LLDRAGDROP32_H +#define NOMINMAX #include <windows.h> #include <ole2.h> 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 <winsock2.h> #include <windows.h> 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 <windows.h> |