Fix xcode16 build errors

master
Andrey Lihatskiy 2025-02-13 16:13:50 +02:00
parent 646d0779bd
commit ddbe1ff981
14 changed files with 44 additions and 38 deletions

View File

@ -68,7 +68,11 @@ public:
} }
// shadow base-class string() method with UTF-8 aware method // shadow base-class string() method with UTF-8 aware method
std::string string() const { return super::u8string(); } std::string string() const
{
auto u8 = super::u8string();
return std::string(u8.begin(), u8.end());
}
// On Posix systems, where value_type is already char, this operator // On Posix systems, where value_type is already char, this operator
// std::string() method shadows the base class operator string_type() // std::string() method shadows the base class operator string_type()
// method. But on Windows, where value_type is wchar_t, the base class // method. But on Windows, where value_type is wchar_t, the base class

View File

@ -146,7 +146,7 @@ size_t LLQueuedThread::updateQueue(F32 max_time_ms)
// schedule a call to threadedUpdate for every call to updateQueue // schedule a call to threadedUpdate for every call to updateQueue
if (!isQuitting()) if (!isQuitting())
{ {
mRequestQueue.post([=]() mRequestQueue.post([=, this]()
{ {
LL_PROFILE_ZONE_NAMED_CATEGORY_THREAD("qt - update"); LL_PROFILE_ZONE_NAMED_CATEGORY_THREAD("qt - update");
mIdleThread = false; mIdleThread = false;
@ -474,7 +474,7 @@ void LLQueuedThread::processRequest(LLQueuedThread::QueuedRequest* req)
#else #else
using namespace std::chrono_literals; using namespace std::chrono_literals;
auto retry_time = LL::WorkQueue::TimePoint::clock::now() + 16ms; auto retry_time = LL::WorkQueue::TimePoint::clock::now() + 16ms;
mRequestQueue.post([=] mRequestQueue.post([=, this]
{ {
LL_PROFILE_ZONE_NAMED("processRequest - retry"); LL_PROFILE_ZONE_NAMED("processRequest - retry");
if (LL::WorkQueue::TimePoint::clock::now() < retry_time) if (LL::WorkQueue::TimePoint::clock::now() < retry_time)

View File

@ -715,7 +715,7 @@ void LLFontFreetype::renderGlyph(EFontGlyphType bitmap_type, U32 glyph_index, ll
if (error == FT_Err_Out_Of_Memory) if (error == FT_Err_Out_Of_Memory)
{ {
LLError::LLUserWarningMsg::showOutOfMemory(); LLError::LLUserWarningMsg::showOutOfMemory();
LL_ERRS() << "Out of memory loading glyph for character " << wch << LL_ENDL; LL_ERRS() << "Out of memory loading glyph for character " << static_cast<unsigned int>(wch) << LL_ENDL;
} }
std::string message = llformat( std::string message = llformat(

View File

@ -1773,7 +1773,7 @@ void LLImageGL::syncToMainThread(LLGLuint new_tex_name)
ref(); ref();
LL::WorkQueue::postMaybe( LL::WorkQueue::postMaybe(
mMainQueue, mMainQueue,
[=]() [=, this]()
{ {
LL_PROFILE_ZONE_NAMED("cglt - delete callback"); LL_PROFILE_ZONE_NAMED("cglt - delete callback");
syncTexName(new_tex_name); syncTexName(new_tex_name);

View File

@ -1060,7 +1060,7 @@ F32 LLWindowMacOSX::getGamma()
&greenGamma, &greenGamma,
&blueMin, &blueMin,
&blueMax, &blueMax,
&blueGamma) == noErr) &blueGamma) == kCGErrorSuccess)
{ {
// So many choices... // So many choices...
// Let's just return the green channel gamma for now. // Let's just return the green channel gamma for now.
@ -1111,7 +1111,7 @@ bool LLWindowMacOSX::setGamma(const F32 gamma)
&greenGamma, &greenGamma,
&blueMin, &blueMin,
&blueMax, &blueMax,
&blueGamma) != noErr) &blueGamma) != kCGErrorSuccess)
{ {
return false; return false;
} }
@ -1126,7 +1126,7 @@ bool LLWindowMacOSX::setGamma(const F32 gamma)
gamma, gamma,
blueMin, blueMin,
blueMax, blueMax,
gamma) != noErr) gamma) != kCGErrorSuccess)
{ {
return false; return false;
} }
@ -1178,7 +1178,7 @@ bool LLWindowMacOSX::setCursorPosition(const LLCoordWindow position)
newPosition.y = screen_pos.mY; newPosition.y = screen_pos.mY;
CGSetLocalEventsSuppressionInterval(0.0); CGSetLocalEventsSuppressionInterval(0.0);
if(CGWarpMouseCursorPosition(newPosition) == noErr) if(CGWarpMouseCursorPosition(newPosition) == kCGErrorSuccess)
{ {
result = true; result = true;
} }

View File

@ -500,7 +500,7 @@ void GLTFSceneManager::update()
LLNewBufferedResourceUploadInfo::uploadFinish_f finish = [this, buffer](LLUUID assetId, LLSD response) LLNewBufferedResourceUploadInfo::uploadFinish_f finish = [this, buffer](LLUUID assetId, LLSD response)
{ {
LLAppViewer::instance()->postToMainCoro( LLAppViewer::instance()->postToMainCoro(
[=]() [=, this]()
{ {
if (mUploadingAsset) if (mUploadingAsset)
{ {

View File

@ -548,8 +548,8 @@ LLViewerFetchedTexture* LLMeshUploadThread::FindViewerTexture(const LLImportMate
return ppTex ? (*ppTex).get() : NULL; return ppTex ? (*ppTex).get() : NULL;
} }
volatile S32 LLMeshRepoThread::sActiveHeaderRequests = 0; std::atomic<S32> LLMeshRepoThread::sActiveHeaderRequests = 0;
volatile S32 LLMeshRepoThread::sActiveLODRequests = 0; std::atomic<S32> LLMeshRepoThread::sActiveLODRequests = 0;
U32 LLMeshRepoThread::sMaxConcurrentRequests = 1; U32 LLMeshRepoThread::sMaxConcurrentRequests = 1;
S32 LLMeshRepoThread::sRequestLowWater = REQUEST2_LOW_WATER_MIN; S32 LLMeshRepoThread::sRequestLowWater = REQUEST2_LOW_WATER_MIN;
S32 LLMeshRepoThread::sRequestHighWater = REQUEST2_HIGH_WATER_MIN; S32 LLMeshRepoThread::sRequestHighWater = REQUEST2_HIGH_WATER_MIN;
@ -3916,7 +3916,7 @@ void LLMeshRepository::notifyLoadedMeshes()
} }
// erase from background thread // erase from background thread
mThread->mWorkQueue.post([=]() mThread->mWorkQueue.post([=, this]()
{ {
mThread->mSkinMap.erase(id); mThread->mSkinMap.erase(id);
}); });

View File

@ -256,8 +256,8 @@ class LLMeshRepoThread : public LLThread
{ {
public: public:
volatile static S32 sActiveHeaderRequests; static std::atomic<S32> sActiveHeaderRequests;
volatile static S32 sActiveLODRequests; static std::atomic<S32> sActiveLODRequests;
static U32 sMaxConcurrentRequests; static U32 sMaxConcurrentRequests;
static S32 sRequestLowWater; static S32 sRequestLowWater;
static S32 sRequestHighWater; static S32 sRequestHighWater;

View File

@ -438,7 +438,7 @@ void LLPanelEmojiComplete::updateConstraints()
{ {
mRenderRect = getLocalRect(); mRenderRect = getLocalRect();
mEmojiWidth = (U16)(mIconFont->getWidthF32(u8"\U0001F431") + mPadding * 2); mEmojiWidth = (U16)(mIconFont->getWidthF32(LLWString(1, 0x1F431).c_str()) + mPadding * 2);
if (mVertical) if (mVertical)
{ {
mEmojiHeight = mIconFont->getLineHeight() + mPadding * 2; mEmojiHeight = mIconFont->getLineHeight() + mPadding * 2;

View File

@ -29,6 +29,7 @@
#include <iostream> #include <iostream>
#include <map> #include <map>
#include <algorithm> #include <algorithm>
#include <atomic>
#include "lltexturefetch.h" #include "lltexturefetch.h"
@ -2843,7 +2844,7 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level, S3
bool LLTextureFetch::updateRequestPriority(const LLUUID& id, F32 priority) bool LLTextureFetch::updateRequestPriority(const LLUUID& id, F32 priority)
{ {
LL_PROFILE_ZONE_SCOPED; LL_PROFILE_ZONE_SCOPED;
mRequestQueue.tryPost([=]() mRequestQueue.tryPost([=, this]()
{ {
LLTextureFetchWorker* worker = getWorker(id); LLTextureFetchWorker* worker = getWorker(id);
if (worker) if (worker)
@ -3571,29 +3572,30 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher)
//if (! gViewerAssetStatsThread1) //if (! gViewerAssetStatsThread1)
// return true; // return true;
static volatile bool reporting_started(false); static std::atomic<bool> reporting_started(false);
static volatile S32 report_sequence(0); static std::atomic<S32> report_sequence(0);
// In mStatsSD, we have a copy we own of the LLSD representation // In mStatsSD, we have a copy we own of the LLSD representation
// of the asset stats. Add some additional fields and ship it off. // of the asset stats. Add some additional fields and ship it off.
static const S32 metrics_data_version = 2; static const S32 metrics_data_version = 2;
bool initial_report = !reporting_started; bool initial_report = !reporting_started.load();
mStatsSD["session_id"] = mSessionID; mStatsSD["session_id"] = mSessionID;
mStatsSD["agent_id"] = mAgentID; mStatsSD["agent_id"] = mAgentID;
mStatsSD["message"] = "ViewerAssetMetrics"; mStatsSD["message"] = "ViewerAssetMetrics";
mStatsSD["sequence"] = report_sequence; mStatsSD["sequence"] = report_sequence.load();
mStatsSD["initial"] = initial_report; mStatsSD["initial"] = initial_report;
mStatsSD["version"] = metrics_data_version; mStatsSD["version"] = metrics_data_version;
mStatsSD["break"] = static_cast<bool>(LLTextureFetch::svMetricsDataBreak); mStatsSD["break"] = static_cast<bool>(LLTextureFetch::svMetricsDataBreak);
// Update sequence number // Update sequence number
if (S32_MAX == ++report_sequence) if (S32_MAX == report_sequence.fetch_add(1))
{ {
report_sequence = 0; report_sequence.store(0);
} }
reporting_started = true;
reporting_started.store(true);
// Limit the size of the stats report if necessary. // Limit the size of the stats report if necessary.

View File

@ -2902,14 +2902,14 @@ void LLViewerMediaImpl::update()
media_tex->ref(); media_tex->ref();
main_queue->postTo( main_queue->postTo(
mTexUpdateQueue, // Worker thread queue mTexUpdateQueue, // Worker thread queue
[=]() // work done on update worker thread [=, this]() // work done on update worker thread
{ {
#if LL_IMAGEGL_THREAD_CHECK #if LL_IMAGEGL_THREAD_CHECK
media_tex->getGLTexture()->mActiveThread = LLThread::currentID(); media_tex->getGLTexture()->mActiveThread = LLThread::currentID();
#endif #endif
doMediaTexUpdate(media_tex, data, data_width, data_height, x_pos, y_pos, width, height, true); doMediaTexUpdate(media_tex, data, data_width, data_height, x_pos, y_pos, width, height, true);
}, },
[=]() // callback to main thread [=, this]() // callback to main thread
{ {
#if LL_IMAGEGL_THREAD_CHECK #if LL_IMAGEGL_THREAD_CHECK
media_tex->getGLTexture()->mActiveThread = LLThread::currentID(); media_tex->getGLTexture()->mActiveThread = LLThread::currentID();

View File

@ -1331,7 +1331,7 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi
// Check the whitelist, if there's media (otherwise just show it) // Check the whitelist, if there's media (otherwise just show it)
if (te->getMediaData() == NULL || te->getMediaData()->checkCandidateUrl(url)) if (te->getMediaData() == NULL || te->getMediaData()->checkCandidateUrl(url))
{ {
if ( obj != mDragHoveredObject) if ( obj != mDragHoveredObject.get())
{ {
// Highlight the dragged object // Highlight the dragged object
LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject);

View File

@ -556,7 +556,7 @@ void LLWebRTCVoiceClient::voiceConnectionCoro()
} }
} }
LL::WorkQueue::postMaybe(mMainQueue, LL::WorkQueue::postMaybe(mMainQueue,
[=] { [=, this] {
if (sShuttingDown) if (sShuttingDown)
{ {
return; return;
@ -674,7 +674,7 @@ void LLWebRTCVoiceClient::OnDevicesChanged(const llwebrtc::LLWebRTCVoiceDeviceLi
{ {
LL::WorkQueue::postMaybe(mMainQueue, LL::WorkQueue::postMaybe(mMainQueue,
[=] [=, this]
{ {
OnDevicesChangedImpl(render_devices, capture_devices); OnDevicesChangedImpl(render_devices, capture_devices);
}); });
@ -2211,7 +2211,7 @@ LLVoiceWebRTCConnection::~LLVoiceWebRTCConnection()
void LLVoiceWebRTCConnection::OnIceGatheringState(llwebrtc::LLWebRTCSignalingObserver::EIceGatheringState state) void LLVoiceWebRTCConnection::OnIceGatheringState(llwebrtc::LLWebRTCSignalingObserver::EIceGatheringState state)
{ {
LL::WorkQueue::postMaybe(mMainQueue, LL::WorkQueue::postMaybe(mMainQueue,
[=] { [=, this] {
LL_DEBUGS("Voice") << "Ice Gathering voice account. " << state << LL_ENDL; LL_DEBUGS("Voice") << "Ice Gathering voice account. " << state << LL_ENDL;
switch (state) switch (state)
@ -2234,7 +2234,7 @@ void LLVoiceWebRTCConnection::OnIceGatheringState(llwebrtc::LLWebRTCSignalingObs
// callback from llwebrtc // callback from llwebrtc
void LLVoiceWebRTCConnection::OnIceCandidate(const llwebrtc::LLWebRTCIceCandidate& candidate) void LLVoiceWebRTCConnection::OnIceCandidate(const llwebrtc::LLWebRTCIceCandidate& candidate)
{ {
LL::WorkQueue::postMaybe(mMainQueue, [=] { mIceCandidates.push_back(candidate); }); LL::WorkQueue::postMaybe(mMainQueue, [=, this] { mIceCandidates.push_back(candidate); });
} }
void LLVoiceWebRTCConnection::processIceUpdates() void LLVoiceWebRTCConnection::processIceUpdates()
@ -2352,7 +2352,7 @@ void LLVoiceWebRTCConnection::processIceUpdatesCoro(connectionPtr_t connection)
void LLVoiceWebRTCConnection::OnOfferAvailable(const std::string &sdp) void LLVoiceWebRTCConnection::OnOfferAvailable(const std::string &sdp)
{ {
LL::WorkQueue::postMaybe(mMainQueue, LL::WorkQueue::postMaybe(mMainQueue,
[=] { [=, this] {
if (mShutDown) if (mShutDown)
{ {
return; return;
@ -2379,7 +2379,7 @@ void LLVoiceWebRTCConnection::OnOfferAvailable(const std::string &sdp)
void LLVoiceWebRTCConnection::OnAudioEstablished(llwebrtc::LLWebRTCAudioInterface* audio_interface) void LLVoiceWebRTCConnection::OnAudioEstablished(llwebrtc::LLWebRTCAudioInterface* audio_interface)
{ {
LL::WorkQueue::postMaybe(mMainQueue, LL::WorkQueue::postMaybe(mMainQueue,
[=] { [=, this] {
if (mShutDown) if (mShutDown)
{ {
return; return;
@ -2401,7 +2401,7 @@ void LLVoiceWebRTCConnection::OnAudioEstablished(llwebrtc::LLWebRTCAudioInterfac
void LLVoiceWebRTCConnection::OnRenegotiationNeeded() void LLVoiceWebRTCConnection::OnRenegotiationNeeded()
{ {
LL::WorkQueue::postMaybe(mMainQueue, LL::WorkQueue::postMaybe(mMainQueue,
[=] { [=, this] {
LL_DEBUGS("Voice") << "Voice channel requires renegotiation." << LL_ENDL; LL_DEBUGS("Voice") << "Voice channel requires renegotiation." << LL_ENDL;
if (!mShutDown) if (!mShutDown)
{ {
@ -2415,7 +2415,7 @@ void LLVoiceWebRTCConnection::OnRenegotiationNeeded()
void LLVoiceWebRTCConnection::OnPeerConnectionClosed() void LLVoiceWebRTCConnection::OnPeerConnectionClosed()
{ {
LL::WorkQueue::postMaybe(mMainQueue, LL::WorkQueue::postMaybe(mMainQueue,
[=] { [=, this] {
LL_DEBUGS("Voice") << "Peer connection has closed." << LL_ENDL; LL_DEBUGS("Voice") << "Peer connection has closed." << LL_ENDL;
if (mVoiceConnectionState == VOICE_STATE_WAIT_FOR_CLOSE) if (mVoiceConnectionState == VOICE_STATE_WAIT_FOR_CLOSE)
{ {
@ -2888,7 +2888,7 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
// llwebrtc callback // llwebrtc callback
void LLVoiceWebRTCConnection::OnDataReceived(const std::string& data, bool binary) void LLVoiceWebRTCConnection::OnDataReceived(const std::string& data, bool binary)
{ {
LL::WorkQueue::postMaybe(mMainQueue, [=] { LLVoiceWebRTCConnection::OnDataReceivedImpl(data, binary); }); LL::WorkQueue::postMaybe(mMainQueue, [=, this] { LLVoiceWebRTCConnection::OnDataReceivedImpl(data, binary); });
} }
// //
@ -3044,7 +3044,7 @@ void LLVoiceWebRTCConnection::OnDataReceivedImpl(const std::string &data, bool b
void LLVoiceWebRTCConnection::OnDataChannelReady(llwebrtc::LLWebRTCDataInterface *data_interface) void LLVoiceWebRTCConnection::OnDataChannelReady(llwebrtc::LLWebRTCDataInterface *data_interface)
{ {
LL::WorkQueue::postMaybe(mMainQueue, LL::WorkQueue::postMaybe(mMainQueue,
[=] { [=, this] {
if (mShutDown) if (mShutDown)
{ {
return; return;

View File

@ -128,7 +128,7 @@ void LLLogin::Impl::connect(const std::string& uri, const LLSD& login_params)
// Launch a coroutine with our login_() method. Run the coroutine until // Launch a coroutine with our login_() method. Run the coroutine until
// its first wait; at that point, return here. // its first wait; at that point, return here.
std::string coroname = std::string coroname =
LLCoros::instance().launch("LLLogin::Impl::login_", [=]() { loginCoro(uri, login_params); }); LLCoros::instance().launch("LLLogin::Impl::login_", [=, this]() { loginCoro(uri, login_params); });
LL_DEBUGS("LLLogin") << " connected with uri '" << uri << "', login_params " << login_params << LL_ENDL; LL_DEBUGS("LLLogin") << " connected with uri '" << uri << "', login_params " << login_params << LL_ENDL;
} }