From 696c89e2c55346e655c19080b22083be2d9e4276 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 21 Feb 2003 20:22:32 +0000 Subject: [PATCH] Added #include to keep OSX build compiling. Reverted the mymax implementation to std::max, hopefully this should be ok now that we have standardised on non native STL under VisualStudio. --- src/osg/ApplicationUsage.cpp | 2 ++ src/osg/State.cpp | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/osg/ApplicationUsage.cpp b/src/osg/ApplicationUsage.cpp index 0bfdc3f38..8128d2b6b 100644 --- a/src/osg/ApplicationUsage.cpp +++ b/src/osg/ApplicationUsage.cpp @@ -1,5 +1,7 @@ #include +#include + using namespace osg; ApplicationUsage::ApplicationUsage(const std::string& commandLineUsage): diff --git a/src/osg/State.cpp b/src/osg/State.cpp index c27d04519..30728c035 100644 --- a/src/osg/State.cpp +++ b/src/osg/State.cpp @@ -198,12 +198,13 @@ void State::captureCurrentState(StateSet& stateset) const } -// visual studio 6.0 doesn't appear to define std::max?!? So do our own here.. -template -T mymax(const T& a,const T& b) -{ - return (((a) > (b)) ? (a) : (b)); -} +// revert to using std::max for consistency, std::max should be defined by STLport on VS. +// // visual studio 6.0 doesn't appear to define std::max?!? So do our own here.. +// template +// T mymax(const T& a,const T& b) +// { +// return (((a) > (b)) ? (a) : (b)); +// } void State::apply(const StateSet* dstate) { @@ -224,9 +225,9 @@ void State::apply(const StateSet* dstate) const StateSet::TextureAttributeList& ds_textureAttributeList = dstate->getTextureAttributeList(); unsigned int unit; - unsigned int unitMax = mymax(static_cast(ds_textureModeList.size()),static_cast(ds_textureAttributeList.size())); - unitMax = mymax(static_cast(unitMax),static_cast(_textureModeMapList.size())); - unitMax = mymax(static_cast(unitMax),static_cast(_textureAttributeMapList.size())); + unsigned int unitMax = std::max(static_cast(ds_textureModeList.size()),static_cast(ds_textureAttributeList.size())); + unitMax = std::max(static_cast(unitMax),static_cast(_textureModeMapList.size())); + unitMax = std::max(static_cast(unitMax),static_cast(_textureAttributeMapList.size())); for(unit=0;unit