diff --git a/autobuild.xml b/autobuild.xml index 5008f49113..95e34e4d24 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -71,9 +71,9 @@ archive hash - 370de49a91ce91516697db8968f5e8b0 + 47ddd059d48f650e39796c10ea828689 url - http://downloads.phoenixviewer.com/ndPhysicsStub-1.0-darwin-201505191946-r76.tar.bz2 + http://downloads.phoenixviewer.com/ndPhysicsStub-1.0-darwin-201606211534-r77.tar.bz2 name darwin @@ -295,9 +295,9 @@ archive hash - d0abfb393024eea8cffdfde3ec5b673d + 72b06fb0bbc1d52179abf8bd8db9b2df url - http://downloads.phoenixviewer.com/boost-1.57-darwin-201505120538-r136.tar.bz2 + http://downloads.phoenixviewer.com/boost-1.57-darwin64-201606171648.tar.bz2 name darwin @@ -347,9 +347,9 @@ archive hash - b93d42a16c5a9e6731ca57d363c231e0 + a1964fea0954d31c3aa29ae196b17f8f url - http://downloads.phoenixviewer.com/colladadom-2.3.201505131932-r98-darwin-201505131932-r98.tar.bz2 + http://downloads.phoenixviewer.com/colladadom-2.3.201606172015-darwin-201606172015.tar.bz2 name darwin @@ -975,9 +975,9 @@ archive hash - af760536a469b6e28df675d4c7eca54b + 9253e0ebde03d4c2161dfeaf02565758 url - http://downloads.phoenixviewer.com/google_breakpad-1413.201505171732-r96-darwin-201505171732-r96.tar.bz2 + http://downloads.phoenixviewer.com/google_breakpad-1413.201606211136-r97-darwin-201606211136-r97.tar.bz2 name darwin @@ -1301,9 +1301,9 @@ archive hash - bf4bb114d861213eb946c6e8b7e35178 + a087b1642025efa765e47e8149b026ee url - http://downloads.phoenixviewer.com/jsoncpp-0.5.0.201508041108-r34-darwin-201508041108-r34.tar.bz2 + http://downloads.phoenixviewer.com/jsoncpp-0.5.0.201606172236-r32-darwin-201606172236-r32.tar.bz2 name darwin @@ -2135,9 +2135,9 @@ archive hash - 64b2e1e2e4869c56c235ba43c1e66bdb + 582d360d195d3dfb48695cb5e206cbf1 url - http://downloads.phoenixviewer.com/pcre-8.35.-darwin-201505122041-r52.tar.bz2 + http://downloads.phoenixviewer.com/pcre-8.35.-darwin-201606171942.tar.bz2 name darwin diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 0ff2985b80..a840dbe5e9 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -312,6 +312,9 @@ if (DARWIN) set(CMAKE_CXX_LINK_FLAGS "-Wl,-no_compact_unwind -Wl,-headerpad_max_install_names,-search_paths_first") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}") set(DARWIN_extra_cstar_flags "-g -Wno-unused-local-typedef -Wno-deprecated-declarations") + # Take a deep breath and turn on C++11... + set(DARWIN_extra_cstar_flags "-std=c++11 -stdlib=libc++ -Wno-overloaded-virtual ${DARWIN_extra_cstar_flags}") + # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}") # NOTE: it's critical that the optimization flag is put in front. diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index b5da4d88ea..9452a91780 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -152,16 +152,18 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(DARWIN 1) # now we only support Xcode 6.0 using 10.9 (Mavericks), minimum OS 10.7 (Lion) - set(XCODE_VERSION 6.0) + set(XCODE_VERSION 7.3) set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7) - set(CMAKE_OSX_SYSROOT macosx10.9) + set(CMAKE_OSX_SYSROOT macosx10.11) set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0") set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL 3) set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO) set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH NO) set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS ssse3) - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++") + # Need libc++ for C++11 and Boost + #set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym) # Build only for i386 by default, system default on MacOSX 10.6+ is x86_64 diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h index 3e25228aeb..6dfabd5f94 100644 --- a/indra/llcommon/llfile.h +++ b/indra/llcommon/llfile.h @@ -45,7 +45,10 @@ typedef FILE LLFILE; typedef struct _stat llstat; #else typedef struct stat llstat; -#include +// This file only exists on Linux +# if LL_LINUX +# include +# endif #endif #ifndef S_ISREG diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index 6aa62554c3..2f194658b5 100644 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -201,7 +201,7 @@ #elif LL_LINUX #define LL_TYPEOF(exp) typeof(exp) #elif LL_DARWIN -#define LL_TYPEOF(exp) typeof(exp) +#define LL_TYPEOF(exp) decltype(exp) #endif #define LL_TO_STRING_HELPER(x) #x diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index f0e1d571a4..1364a08949 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -444,7 +444,7 @@ public: struct LLDictionaryLess { public: - bool operator()(const std::string& a, const std::string& b) + bool operator()(const std::string& a, const std::string& b) const { return (LLStringUtil::precedesDict(a, b) ? true : false); } diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp index 79a64b24f2..aa84374372 100644 --- a/indra/llmath/v4color.cpp +++ b/indra/llmath/v4color.cpp @@ -122,7 +122,7 @@ LLColor4 LLColor4::cyan6(0.2f, 0.6f, 0.6f, 1.0f); ////////////////////////////////////////////////////////////////////////////// // conversion -LLColor4::operator const LLColor4U() const +LLColor4::operator /*const*/ LLColor4U() const { return LLColor4U( (U8)llclampb(ll_round(mV[VRED]*255.f)), diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h index 0d632f59be..7d553ef62a 100644 --- a/indra/llmath/v4color.h +++ b/indra/llmath/v4color.h @@ -131,7 +131,7 @@ class LLColor4 friend const LLColor4& operator*=(LLColor4 &a, const LLColor4 &b); // Doesn't multiply alpha! (for lighting) // conversion - operator const LLColor4U() const; + operator /*const*/ LLColor4U() const; // Basic color values. static LLColor4 red; diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h index 5d525762a4..2101efc5fc 100644 --- a/indra/llmath/v4coloru.h +++ b/indra/llmath/v4coloru.h @@ -130,7 +130,7 @@ public: static BOOL parseColor4U(const std::string& buf, LLColor4U* value); // conversion - operator const LLColor4() const + operator /*const*/ LLColor4() const { return LLColor4(*this); } diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index f381e92a4d..ba7cfc5d10 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -126,7 +126,7 @@ private: F32 mValue; LLUIColor mColor; - bool operator <(const Threshold& other) + bool operator <(const Threshold& other) const { return mValue < other.mValue; } diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index a78fec1f2e..cd6147fbf2 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -236,8 +236,8 @@ attributedStringInfo getSegments(NSAttributedString *str) NSOpenGLPFADoubleBuffer, NSOpenGLPFAClosestPolicy, NSOpenGLPFAAccelerated, - NSOpenGLPFASampleBuffers, (samples > 0 ? 1 : 0), - NSOpenGLPFASamples, samples, + NSOpenGLPFASampleBuffers, static_cast(samples > 0 ? 1 : 0), + NSOpenGLPFASamples, static_cast(samples), NSOpenGLPFAStencilSize, 8, NSOpenGLPFADepthSize, 24, NSOpenGLPFAAlphaSize, 8, @@ -380,8 +380,8 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void)mouseMoved:(NSEvent *)theEvent { float mouseDeltas[2] = { - [theEvent deltaX], - [theEvent deltaY] + static_cast([theEvent deltaX]), + static_cast([theEvent deltaY]) }; callDeltaUpdate(mouseDeltas, 0); @@ -401,8 +401,8 @@ attributedStringInfo getSegments(NSAttributedString *str) // The old CoreGraphics APIs we previously relied on are now flagged as obsolete. // NSEvent isn't obsolete, and provides us with the correct deltas. float mouseDeltas[2] = { - [theEvent deltaX], - [theEvent deltaY] + static_cast([theEvent deltaX]), + static_cast([theEvent deltaY]) }; callDeltaUpdate(mouseDeltas, 0); @@ -604,13 +604,13 @@ attributedStringInfo getSegments(NSAttributedString *str) if (mMarkedTextAllowed) { unsigned int selected[2] = { - selectedRange.location, - selectedRange.length + static_cast(selectedRange.location), + static_cast(selectedRange.length) }; unsigned int replacement[2] = { - replacementRange.location, - replacementRange.length + static_cast(replacementRange.location), + static_cast(replacementRange.length) }; int string_length = [aString length]; diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 07861f125e..978a5d0aac 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -553,7 +553,7 @@ void getPreeditLocation(float *location, unsigned int length) preeditor->getPreeditLocation(length, &coord, &rect, NULL); - float c[4] = {coord.mX, coord.mY, 0, 0}; + float c[4] = {static_cast(coord.mX), static_cast(coord.mY), 0, 0}; convertRectToScreen(gWindowImplementation->getWindow(), c); @@ -909,7 +909,7 @@ BOOL LLWindowMacOSX::setPosition(const LLCoordScreen position) { if(mWindow) { - float pos[2] = {position.mX, position.mY}; + float pos[2] = {static_cast(position.mX), static_cast(position.mY)}; setWindowPos(mWindow, pos); } diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index c0a89bc0a4..b2ed17364c 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -109,7 +109,9 @@ callWindowUnhide(); } -- (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender +// This got changed at some point in the SDK. +//- (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender +- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender { if (!runMainLoop()) { diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 8b4078488a..1a3da9c092 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -297,7 +297,7 @@ void LLAppViewerMacOSX::initCrashReporting(bool reportFreeze) std::string appname = gDirUtilp->getExecutableFilename(); std::string str[] = { "-pid", pid_str.str(), "-dumpdir", logdir, "-procname", appname.c_str() }; std::vector< std::string > args( str, str + ( sizeof ( str ) / sizeof ( std::string ) ) ); - LL_WARNS() << "about to launch mac-crash-logger" << pid_str << " " << logdir << " " << appname << LL_ENDL; + LL_WARNS() << "about to launch mac-crash-logger" << pid_str.str() << " " << logdir << " " << appname << LL_ENDL; launchApplication(&command_str, &args); } diff --git a/indra/newview/llpanelexperiencelisteditor.cpp b/indra/newview/llpanelexperiencelisteditor.cpp index 254b959259..3a921a7e35 100644 --- a/indra/newview/llpanelexperiencelisteditor.cpp +++ b/indra/newview/llpanelexperiencelisteditor.cpp @@ -95,8 +95,8 @@ void LLPanelExperienceListEditor::setExperienceIds( const LLSD& experience_ids ) { mExperienceIds.clear(); // [SL:KB] - Because GCC likes to be special -// ...and Clang doesn't (argh!) -#if LL_GNUC +// ...and Clang does too +#if LL_GNUC || LL_CLANG std::transform(experience_ids.beginArray(), experience_ids.endArray(), std::inserter(mExperienceIds, mExperienceIds.end()), [](const LLSD& sd) { return sd.asUUID(); }); #else mExperienceIds.insert(experience_ids.beginArray(), experience_ids.endArray()); diff --git a/indra/newview/llsearchhistory.cpp b/indra/newview/llsearchhistory.cpp index 0ea05a03d6..0c643a5b0a 100644 --- a/indra/newview/llsearchhistory.cpp +++ b/indra/newview/llsearchhistory.cpp @@ -116,7 +116,7 @@ void LLSearchHistory::addEntry(const std::string& search_query) mSearchHistory.push_front(item); } -bool LLSearchHistory::LLSearchHistoryItem::operator < (const LLSearchHistory::LLSearchHistoryItem& right) +bool LLSearchHistory::LLSearchHistoryItem::operator < (const LLSearchHistory::LLSearchHistoryItem& right) const { S32 result = LLStringUtil::compareInsensitive(search_query, right.search_query); diff --git a/indra/newview/llsearchhistory.h b/indra/newview/llsearchhistory.h index 3309a8fcac..11d03f8173 100644 --- a/indra/newview/llsearchhistory.h +++ b/indra/newview/llsearchhistory.h @@ -98,7 +98,7 @@ public: /** * Allows std::list sorting */ - bool operator < (const LLSearchHistory::LLSearchHistoryItem& right); + bool operator < (const LLSearchHistory::LLSearchHistoryItem& right) const; /** * Allows std::list sorting diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index d7b6f021e0..e93c076fe5 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -313,7 +313,12 @@ U32Bytes gTotalWorldData, U32 gSimPingCount = 0; U32Bits gObjectData; F32Milliseconds gAvgSimPing(0.f); +// Deal with Clang C++11 pedantry +#if LL_CLANG +U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY]; +#else U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {U32Bytes(0)}; +#endif extern U32 gVisCompared; extern U32 gVisTested; diff --git a/indra/newview/rlvhandler.h b/indra/newview/rlvhandler.h index c389d9ca3f..26dbb3c774 100644 --- a/indra/newview/rlvhandler.h +++ b/indra/newview/rlvhandler.h @@ -20,8 +20,8 @@ #include #include "rlvcommon.h" -#if LL_GNUC -#include "rlvhelper.h" // Needed to make GCC happy +#if LL_GNUC || LL_CLANG +#include "rlvhelper.h" // Needed to make GCC and Clang happy #endif // LL_GNUC // ============================================================================