From Laurens Voerman, "While compiling with Visual Studio 12 (aka 2013 update 3) I get a these errors:

E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(364): error C2039: 'min' : is not a member of 'std'
E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(364): error C3861: 'min': identifier not found
E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(372): error C2039: 'min' : is not a member of 'std'
E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(372): error C3861: 'min': identifier not found
E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(381): error C2039: 'min' : is not a member of 'std'
E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(381): error C3861: 'min': identifier not found
E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(436): error C2039: 'min' : is not a member of 'std'
E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(436): error C3861: 'min': identifier not found

I suggest to replace std::min by osg::minimum, attached is a (zipped) modified version of src/osg/PrimitiveSet.cpp
applies to the git reposetory only (updated 1 Feb 2016 ae6bade641ee4d8436ef69e7a7a347be81195a47 )

"
This commit is contained in:
Robert Osfield
2016-02-04 19:38:23 +00:00
parent dcadd69c5a
commit e1eaeced8c

View File

@@ -361,7 +361,7 @@ void MultiDrawArrays::draw(osg::State& state, bool) const
GLExtensions* ext = state.get<GLExtensions>();
if (ext->glMultiDrawArrays)
{
GLsizei primcount = std::min(_firsts.size(), _counts.size());
GLsizei primcount = osg::minimum(_firsts.size(), _counts.size());
ext->glMultiDrawArrays(_mode, &_firsts.front(), &_counts.front(), primcount);
}
@@ -369,7 +369,7 @@ void MultiDrawArrays::draw(osg::State& state, bool) const
void MultiDrawArrays::accept(PrimitiveFunctor& functor) const
{
unsigned int primcount = std::min(_firsts.size(), _counts.size());
unsigned int primcount = osg::minimum(_firsts.size(), _counts.size());
for(unsigned int i=0; i<primcount; ++i)
{
functor.drawArrays(_mode, _firsts[i], _counts[i]);
@@ -378,7 +378,7 @@ void MultiDrawArrays::accept(PrimitiveFunctor& functor) const
void MultiDrawArrays::accept(PrimitiveIndexFunctor& functor) const
{
unsigned int primcount = std::min(_firsts.size(), _counts.size());
unsigned int primcount = osg::minimum(_firsts.size(), _counts.size());
for(unsigned int i=0; i<primcount; ++i)
{
functor.drawArrays(_mode, _firsts[i], _counts[i]);
@@ -433,7 +433,7 @@ unsigned int MultiDrawArrays::getNumPrimitives() const
case(PATCHES):
case(POLYGON):
{
unsigned int primcount = std::min(_firsts.size(), _counts.size());
unsigned int primcount = osg::minimum(_firsts.size(), _counts.size());
return primcount;
}
}
@@ -445,4 +445,4 @@ void MultiDrawArrays::add(GLint first, GLsizei count)
_firsts.push_back(first);
_counts.push_back(count);
}
#endif
#endif