From c2b26f6c15c32d4f0aac49763eae956c848d7c1f Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 12 Nov 2012 03:04:24 -0600 Subject: [PATCH] GCC Fixes: Only use C++0x/C++11 features if compiling for windows, or if GCC is configured to support such features (v4.7 onwards: '-std=c++11'. v4.3 through v4.6: '-std=c++0x') Removed an assertion that's no longer possible to evaluate (queue doesn't support iterators). --- indra/llmath/lloctree.h | 5 ++++- indra/newview/llspatialpartition.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index dbdf90174..87153982e 100644 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -677,7 +677,10 @@ public: (mData.size() > gOctreeReserveCapacity && mData.capacity() > gOctreeReserveCapacity + mData.size() - 1 - (mData.size() - gOctreeReserveCapacity - 1) % 4)) { //Shrink to lowest possible (reserve)+4*i size.. Say reserve is 5, here are [size,capacity] pairs. [10,13],[9,9],[8,9],[7,9],[6,9],[5,5],[4,5],[3,5],[2,5],[1,5],[0,5] -#ifndef LL_DARWIN + //For Windows: We always assume vs2010 or later, which support this c++11 feature with no configuration needed. + //For GCC: __cplusplus >= 201103L indicates C++11 support. __GXX_EXPERIMENTAL_CXX0X being set indicates experimental c++0x support. C++11 support replaces C++0x support. + // std::vector::shrink_to_fit was added to GCCs C++0x implementation in version 4.5.0. +#if defined(LL_WINDOWS) || __cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X) && __GNUC_MINOR__ >= 5) mData.shrink_to_fit(); #else std::vector >(mData.begin(), mData.end()).swap(mData); //Need to confirm this works on OSX.. diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index e0e8421f1..5c41199c3 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -125,7 +125,7 @@ protected: #if LL_TRACK_PENDING_OCCLUSION_QUERIES LLSpatialGroup::sPendingQueries.erase(name); #endif - llassert(std::find(mAvailableName.begin(), mAvailableName.end(), name) == mAvailableName.end()); + //llassert(std::find(mAvailableName.begin(), mAvailableName.end(), name) == mAvailableName.end()); mAvailableName.push(name); } };