summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2021-05-07 20:32:04 -0400
committerNat Goodspeed <nat@lindenlab.com>2021-05-07 20:32:04 -0400
commit26fb5d7af70f20c9a125575e1d93f7ff4bcd4f3c (patch)
tree2eefde15cd779dfb8398f774c63c2d5b1cbcdfc9
parentce65bc2f13409d75dbc6502c970030cc5ed2e5ad (diff)
SL-15241: Tweak viewer sources to permit compiling on Mac with C++17.
-rw-r--r--indra/cmake/00-Common.cmake2
-rw-r--r--indra/llinventory/llparcel.cpp2
-rw-r--r--indra/llui/lldockablefloater.h4
-rw-r--r--indra/newview/llappearancemgr.h2
-rw-r--r--indra/newview/llfavoritesbar.cpp2
-rw-r--r--indra/newview/llfloaterregioninfo.cpp4
-rw-r--r--indra/newview/llpaneloutfitedit.h2
-rw-r--r--indra/newview/llpaneloutfitsinventory.h2
-rw-r--r--indra/newview/lltoast.h2
-rw-r--r--indra/newview/llwatchdog.cpp4
-rw-r--r--indra/test/lldoubledispatch_tut.cpp8
11 files changed, 16 insertions, 18 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 8aea50e02b..4b7b54179c 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -175,7 +175,7 @@ if (DARWIN)
# Until we decide to set -std=c++14 in viewer-build-variables/variables, set
# it locally here: we want to at least prevent inadvertently reintroducing
# viewer code that would fail with C++14.
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags} -std=c++14")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags} -std=c++17")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}")
# NOTE: it's critical that the optimization flag is put in front.
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp
index e2469f3c7e..2f577bfb07 100644
--- a/indra/llinventory/llparcel.cpp
+++ b/indra/llinventory/llparcel.cpp
@@ -1268,5 +1268,5 @@ U32 LLParcel::countExperienceKeyType( U32 type )
return std::count_if(
boost::begin(mExperienceKeys | boost::adaptors::map_values),
boost::end(mExperienceKeys | boost::adaptors::map_values),
- std::bind2nd(std::equal_to<U32>(), type));
+ [type](U32 key){ return key == type; });
}
diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h
index 89c9852f4a..1110342f08 100644
--- a/indra/llui/lldockablefloater.h
+++ b/indra/llui/lldockablefloater.h
@@ -108,7 +108,7 @@ public:
*
* By default returns false.
*/
- virtual bool overlapsScreenChannel() { return mOverlapsScreenChannel && getVisible() && isDocked(); }
+ virtual bool overlapsScreenChannel() const { return mOverlapsScreenChannel && getVisible() && isDocked(); }
virtual void setOverlapsScreenChannel(bool overlaps) { mOverlapsScreenChannel = overlaps; }
bool getUniqueDocking() { return mUniqueDocking; }
@@ -131,7 +131,7 @@ protected:
boost::function<BOOL ()> mIsDockedStateForcedCallback;
private:
- std::auto_ptr<LLDockControl> mDockControl;
+ std::unique_ptr<LLDockControl> mDockControl;
LLUIImagePtr mDockTongue;
static LLHandle<LLFloater> sInstanceHandle;
/**
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 8a55a848db..a5265a392f 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -276,7 +276,7 @@ private:
LLUUID mCOFImageID;
- std::auto_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
+ std::unique_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
// Set of temp attachment UUIDs that should be removed
typedef std::set<LLUUID> doomed_temp_attachments_t;
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 7a887a2549..ce2da94009 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -828,7 +828,7 @@ void LLFavoritesBarCtrl::updateButtons()
{
//find last visible child to get the rightest button offset
child_list_const_reverse_iter_t last_visible_it = std::find_if(childs->rbegin(), childs->rend(),
- std::mem_fun(&LLView::getVisible));
+ [](child_list_t::value_type child){ return child->getVisible(); });
if(last_visible_it != childs->rend())
{
last_right_edge = (*last_visible_it)->getRect().mRight;
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index ec1909d02a..0e4bb2ff92 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -636,9 +636,7 @@ void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region)
std::for_each(
mInfoPanels.begin(),
mInfoPanels.end(),
- llbind2nd(
- std::mem_fun(&LLPanelRegionInfo::refreshFromRegion),
- region));
+ [region](info_panels_t::value_type panel){ panel->refreshFromRegion(region); });
mEnvironmentPanel->refreshFromRegion(region);
}
diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h
index 3c6efac0e7..8de3642b55 100644
--- a/indra/newview/llpaneloutfitedit.h
+++ b/indra/newview/llpaneloutfitedit.h
@@ -237,7 +237,7 @@ private:
LLToggleableMenu* mGearMenu;
LLToggleableMenu* mAddWearablesGearMenu;
bool mInitialized;
- std::auto_ptr<LLSaveOutfitComboBtn> mSaveComboBtn;
+ std::unique_ptr<LLSaveOutfitComboBtn> mSaveComboBtn;
LLMenuButton* mWearablesGearMenuBtn;
LLMenuButton* mGearMenuBtn;
diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h
index 6a0ea04fa6..fea789c04c 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -65,7 +65,7 @@ protected:
private:
LLTabContainer* mAppearanceTabs;
std::string mFilterSubString;
- std::auto_ptr<LLSaveOutfitComboBtn> mSaveComboBtn;
+ std::unique_ptr<LLSaveOutfitComboBtn> mSaveComboBtn;
//////////////////////////////////////////////////////////////////////////////////
// tab panels //
diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h
index 69074b1670..2b1fedf74d 100644
--- a/indra/newview/lltoast.h
+++ b/indra/newview/lltoast.h
@@ -222,7 +222,7 @@ private:
LLPanel* mWrapperPanel;
// timer counts a lifetime of a toast
- std::auto_ptr<LLToastLifeTimer> mTimer;
+ std::unique_ptr<LLToastLifeTimer> mTimer;
F32 mToastLifetime; // in seconds
F32 mToastFadingTime; // in seconds
diff --git a/indra/newview/llwatchdog.cpp b/indra/newview/llwatchdog.cpp
index 6273f10c69..52b3c33512 100644
--- a/indra/newview/llwatchdog.cpp
+++ b/indra/newview/llwatchdog.cpp
@@ -235,7 +235,7 @@ void LLWatchdog::run()
LL_INFOS() << "Watchdog thread delayed: resetting entries." << LL_ENDL;
std::for_each(mSuspects.begin(),
mSuspects.end(),
- std::mem_fun(&LLWatchdogEntry::reset)
+ [](SuspectsRegistry::value_type suspect){ suspect->reset(); }
);
}
else
@@ -243,7 +243,7 @@ void LLWatchdog::run()
SuspectsRegistry::iterator result =
std::find_if(mSuspects.begin(),
mSuspects.end(),
- std::not1(std::mem_fun(&LLWatchdogEntry::isAlive))
+ [](SuspectsRegistry::value_type suspect){ return ! suspect->isAlive(); }
);
if(result != mSuspects.end())
{
diff --git a/indra/test/lldoubledispatch_tut.cpp b/indra/test/lldoubledispatch_tut.cpp
index ad8f6454d4..e38d0e92a3 100644
--- a/indra/test/lldoubledispatch_tut.cpp
+++ b/indra/test/lldoubledispatch_tut.cpp
@@ -135,10 +135,10 @@ namespace tut
// Instantiate a few GameObjects. Make sure we refer to them
// polymorphically, and don't let them leak.
- std::auto_ptr<GameObject> home;
- std::auto_ptr<GameObject> obstacle;
- std::auto_ptr<GameObject> tug;
- std::auto_ptr<GameObject> patrol;
+ std::unique_ptr<GameObject> home;
+ std::unique_ptr<GameObject> obstacle;
+ std::unique_ptr<GameObject> tug;
+ std::unique_ptr<GameObject> patrol;
// prototype objects
Asteroid dummyAsteroid;