From 3920d946c6ef0259d113801fb48f1bc176516fee Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Tue, 14 Oct 2014 16:44:29 -0400
Subject: [PATCH] Introduce fast_exit() wrapper for _exit() so we can
 boost::bind() it.

---
 indra/newview/llappviewer.cpp | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 3a5008507ab..b44f54f59c1 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -745,6 +745,15 @@ class LLUITranslationBridge : public LLTranslationBridge
 	}
 };
 
+namespace {
+// With Xcode 6, _exit() is too magical to use with boost::bind(), so provide
+// this little helper function.
+void fast_exit(int rc)
+{
+	_exit(rc);
+}
+}
+
 bool LLAppViewer::init()
 {	
 	setupErrorHandling(mSecondInstance);
@@ -801,10 +810,10 @@ bool LLAppViewer::init()
 	S32 rc(gSavedSettings.getS32("QAModeTermCode"));
 	if (rc >= 0)
 	{
-		// QAModeTermCode set, terminate with that rc on LL_ERRS. Use _exit()
-		// rather than exit() because normal cleanup depends too much on
-		// successful startup!
-		LLError::setFatalFunction(boost::bind(_exit, rc));
+		// QAModeTermCode set, terminate with that rc on LL_ERRS. Use
+		// fast_exit() rather than exit() because normal cleanup depends too
+		// much on successful startup!
+		LLError::setFatalFunction(boost::bind(fast_exit, rc));
 	}
 
     mAlloc.setProfilingEnabled(gSavedSettings.getBOOL("MemProfiling"));
-- 
GitLab