diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index f042409a02dc290adbcb6786cd8f588902b680b8..0000000000000000000000000000000000000000
--- a/.gitattributes
+++ /dev/null
@@ -1,32 +0,0 @@
-*          text=auto
-
-# Sources
-*.cpp      text diff=cpp
-*.h        text diff=cpp
-*.py       text diff=python
-indra/newview/llimprocessing.cpp -text
-
-# Documents
-*.txt      text
-*.xml      text
-indra/tools/vstool/README.txt -text
-indra/newview/installers/windows/FILES_ARE_UNICODE_UTF-16LE.txt -text
-
-# Graphics
-*.png      binary diff=exif
-*.jpg      binary diff=exif
-*.jpeg     binary diff=exif
-*.gif      binary diff=exif
-*.tif      binary
-*.tiff     binary
-*.ico      binary
-*.svg      text
-*.eps      binary
-
-# Scripts
-*.sh       text eol=lf
-*.bat      text eol=crlf
-
-# Exclude files from exporting
-.gitattributes export-ignore
-.gitignore     export-ignore
diff --git a/.gitignore b/.gitignore
index 9186553b32fb4ac1612abc605898f06ea81dcff1..839d14bc0df0f4a1515480a4228836ac21a0be1e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,8 +20,11 @@ indra/.distcc
 build-vc80/
 build-vc100/
 build-vc120/
-build-vc[0-9]*-32/
-build-vc[0-9]*-64/
+build-vc120-32/
+build-vc120-64/
+build-vc150-32/
+build-vc150-64/
+build-vc160-64/
 indra/CMakeFiles
 indra/build-vc[0-9]*
 indra/lib/mono/1.0/*.dll
diff --git a/autobuild.xml b/autobuild.xml
index 8686bc3263e6937ee6608c29be5826166e090688..9185b8af22a8664df2350380757bcb254dfb3952 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -800,9 +800,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>d3d1b920d95551cc332e0e9040d30cbd</string>
+              <string>c36808a58384a52672d81593de61f7ff</string>
               <key>url</key>
-              <string>https://downloads.catznip.com/packages/fmodstudio-2.01.10-darwin64-211781159.tar.bz2</string>
+              <string>https://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/89681/818422/fmodstudio-2.02.03.565082-darwin64-565082.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin64</string>
@@ -836,9 +836,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>6dfd5abf06af96594ad4a709751242d4</string>
+              <string>96853d91ce4da14e14ea322122629551</string>
               <key>url</key>
-              <string>https://downloads.catznip.com/packages/fmodstudio-2.01.04-windows-202701549.tar.bz2</string>
+              <string>https://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/89683/818438/fmodstudio-2.02.03.565082-windows-565082.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
@@ -848,9 +848,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>4ace21ba072a0a058542a79048c5b50b</string>
+              <string>58d0cc28a1d90bacefbda48fcd8d379c</string>
               <key>url</key>
-              <string>https://downloads.catznip.com/packages/fmodstudio-2.01.04-windows64-202701551.tar.bz2</string>
+              <string>https://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/89684/818439/fmodstudio-2.02.03.565082-windows64-565082.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows64</string>
@@ -2750,9 +2750,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>c4dbb4337228b56ae2f7004b002ddaf2</string>
+              <string>222a406ecb4071a9cc9635353afa337e</string>
               <key>url</key>
-              <string>http://viewer.catznip.com/downloads/packages/openjpeg-1.5.2.0-windows-202032010.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/54977/511775/openjpeg-1.5.1.538970-windows-538970.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
@@ -2762,9 +2762,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>2a9519a5e8f03313742c8b3ab2d1ea15</string>
+              <string>5b5c80807fa8161f3480be3d89fe9516</string>
               <key>url</key>
-              <string>http://viewer.catznip.com/downloads/packages/openjpeg-1.5.2.0-windows64-202031901.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/54974/511767/openjpeg-1.5.1.538970-windows64-538970.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows64</string>
@@ -3933,7 +3933,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
         <key>windows</key>
         <map>
           <key>build_directory</key>
-          <string>build-vc${AUTOBUILD_VSVER}-$AUTOBUILD_ADDRSIZE</string>
+          <string>build-vc${AUTOBUILD_VSVER|150}-$AUTOBUILD_ADDRSIZE</string>
           <key>configurations</key>
           <map>
             <key>RelWithDebInfo</key>
@@ -3962,8 +3962,6 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
                 <array>
                   <string>-G</string>
                   <string>${AUTOBUILD_WIN_CMAKE_GEN|NOTWIN}</string>
-                  <string>-A</string>
-                  <string>${AUTOBUILD_WIN_CMAKE_PLAT|NOTWIN}</string>
                 </array>
               </map>
               <key>default</key>
@@ -4002,8 +4000,6 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
                 <array>
                   <string>-G</string>
                   <string>${AUTOBUILD_WIN_CMAKE_GEN|NOTWIN}</string>
-                  <string>-A</string>
-                  <string>${AUTOBUILD_WIN_CMAKE_PLAT|NOTWIN}</string>
                   <string>-DINSTALL_PROPRIETARY=FALSE</string>
                   <string>-DUSE_KDU=FALSE</string>
                   <string>-DOPENAL:BOOL=ON</string>
@@ -4038,8 +4034,6 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
                 <array>
                   <string>-G</string>
                   <string>${AUTOBUILD_WIN_CMAKE_GEN|NOTWIN}</string>
-                  <string>-A</string>
-                  <string>${AUTOBUILD_WIN_CMAKE_PLAT|NOTWIN}</string>
                 </array>
               </map>
               <key>name</key>
@@ -4076,8 +4070,6 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
                 <array>
                   <string>-G</string>
                   <string>${AUTOBUILD_WIN_CMAKE_GEN|NOTWIN}</string>
-                  <string>-A</string>
-                  <string>${AUTOBUILD_WIN_CMAKE_PLAT|NOTWIN}</string>
                   <string>-DUNATTENDED:BOOL=ON</string>
                   <string>-DINSTALL_PROPRIETARY=FALSE</string>
                   <string>-DUSE_KDU=FALSE</string>
diff --git a/build.sh b/build.sh
index 8c1f76f8fa8745e6f012703d6dcfec4a7133375d..89609a9ffd6d3b5b07fa30e6442700b2bf59ce9d 100755
--- a/build.sh
+++ b/build.sh
@@ -51,7 +51,7 @@ build_dir_Linux()
 
 build_dir_CYGWIN()
 {
-  echo build-vc${AUTOBUILD_VSVER}-${AUTOBUILD_ADDRSIZE}
+  echo build-vc${AUTOBUILD_VSVER:-120}-${AUTOBUILD_ADDRSIZE}
 }
 
 viewer_channel_suffix()
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 018836e86fcfcf1be821af6a6f1566ef763d4135..bb5dd8f847449de3dfc1d75f103fa358138235b3 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -19,14 +19,7 @@ set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
 include(Variables)
 
 # We go to some trouble to set LL_BUILD to the set of relevant compiler flags.
-#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{LL_BUILD}")
-set(CMAKE_CXX_FLAGS_RELEASE "$ENV{LL_BUILD_RELEASE}")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "$ENV{LL_BUILD_RELWITHDEBINFO}")
-set(CMAKE_CXX_FLAGS_DEBUG "$ENV{LL_BUILD_DEBUG}")
-set(CMAKE_EXE_LINKER_FLAGS "$ENV{LL_BUILD_BASE_LINKER}")
-set(CMAKE_EXE_LINKER_FLAGS_RELEASE "$ENV{LL_BUILD_RELEASE_LINKER}")
-set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "$ENV{LL_BUILD_RELWITHDEBINFO_LINKER}")
-set(CMAKE_EXE_LINKER_FLAGS_DEBUG "$ENV{LL_BUILD_DEBUG_LINKER}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{LL_BUILD}")
 # Given that, all the flags you see added below are flags NOT present in
 # https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables.
 # Before adding new ones here, it's important to ask: can this flag really be
@@ -36,9 +29,6 @@ set(CMAKE_EXE_LINKER_FLAGS_DEBUG "$ENV{LL_BUILD_DEBUG_LINKER}")
 # Portable compilation flags.
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DADDRESS_SIZE=${ADDRESS_SIZE}")
 
-# Configure asan
-set(ASAN OFF CACHE BOOL "Enable use of asan in builds")
-
 # Configure crash reporting
 set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds")
 set(NON_RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in developer builds")
@@ -70,21 +60,16 @@ if (WINDOWS)
   # http://www.cmake.org/pipermail/cmake/2009-September/032143.html
   string(REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
 
-  if(ASAN)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=address")
-  endif(ASAN)
-
   # Without PreferredToolArchitecture=x64, as of 2020-06-26 the 32-bit
   # compiler on our TeamCity build hosts has started running out of virtual
   # memory for the precompiled header file.
   # CP changed to only append the flag for 32bit builds - on 64bit builds,
   # locally at least, the build output is spammed with 1000s of 'D9002'
   # warnings about this switch being ignored.
-  # [SL:KB] - Moved to variables for the convenience of people who are not Kitty
-  #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
-  #if( ADDRESS_SIZE EQUAL 32 )
-  #  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /p:PreferredToolArchitecture=x64")  
-  #endif()
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")  
+  if( ADDRESS_SIZE EQUAL 32 )
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /p:PreferredToolArchitecture=x64")  
+  endif()
   # Preserve first-pass-through versions (ie no FORCE overwrite). Prevents recursive addition of /Zo (04/2021)
   set(OG_CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} CACHE STRING "OG_CXX_FLAGS_RELEASE")
   set(OG_CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} CACHE STRING "OG_CXX_FLAGS_RELWITHDEBINFO")
diff --git a/indra/cmake/BuildPackagesInfo.cmake b/indra/cmake/BuildPackagesInfo.cmake
index 4caa98cba49423f30645dcb54452e46b36289f71..8f8b6b23300d21e1995347fbfa60dd0091cecaeb 100644
--- a/indra/cmake/BuildPackagesInfo.cmake
+++ b/indra/cmake/BuildPackagesInfo.cmake
@@ -14,7 +14,7 @@ add_custom_command(OUTPUT packages-info.txt
   DEPENDS ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py
           ${CMAKE_SOURCE_DIR}/../autobuild.xml
   COMMAND ${PYTHON_EXECUTABLE}
-          ${CMAKE_SOURCE_DIR}/cmake/run_build_test.py -DAUTOBUILD_ADDRSIZE=${ADDRESS_SIZE} -DAUTOBUILD=${AUTOBUILD_EXECUTABLE} -DAUTOBUILD_VSVER=$ENV{AUTOBUILD_VSVER}
+          ${CMAKE_SOURCE_DIR}/cmake/run_build_test.py -DAUTOBUILD_ADDRSIZE=${ADDRESS_SIZE} -DAUTOBUILD=${AUTOBUILD_EXECUTABLE}
           ${PYTHON_EXECUTABLE}
           ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py "${VIEWER_CHANNEL}" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" > packages-info.txt
   )
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index 2bd2e0b51e29a65c30dc2ca69dc590a36b155ce0..ff705101ded51485ee120cc69017823871d68899 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -101,7 +101,7 @@ if(WINDOWS)
         MESSAGE(STATUS "MSVC_VERSION ${MSVC_VERSION}")
     elseif (MSVC_VERSION EQUAL 1800) # VisualStudio 2013, which is (sigh) VS 12
         set(MSVC_VER 120)
-    elseif (MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1940) # Visual Studio 2017 through 2022
+    elseif (MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920) # Visual Studio 2017
         set(MSVC_VER 140)
     elseif (MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930) # Visual Studio 2019
         set(MSVC_VER 140)
diff --git a/indra/cmake/LLSharedLibs.cmake b/indra/cmake/LLSharedLibs.cmake
index 0773e7587a4c803b1f544a86036ee4a43f2e5213..f69b45cd926193e04ce625a7ae2ed0c1674d2d81 100644
--- a/indra/cmake/LLSharedLibs.cmake
+++ b/indra/cmake/LLSharedLibs.cmake
@@ -18,13 +18,6 @@ macro(ll_deploy_sharedlibs_command target_exe)
   if(NOT DARWIN)
     if(WINDOWS)
       SET_TEST_PATH(SEARCH_DIRS)
-      if(ASAN)
-        if(ADDRESS_SIZE EQUAL 32)
-          LIST(APPEND SEARCH_DIRS "$ENV{VCToolsInstallDir}bin\\Hostx64\\x86")
-        else(ADDRESS_SIZE EQUAL 32)
-          LIST(APPEND SEARCH_DIRS "$ENV{VCToolsInstallDir}bin\\Hostx64\\x64")
-        endif(ADDRESS_SIZE EQUAL 32)
-      endif(ASAN)
       LIST(APPEND SEARCH_DIRS "$ENV{SystemRoot}/system32")
     elseif(LINUX)
       SET_TEST_PATH(SEARCH_DIRS)
diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake
index 18e44d72e53092a7c81c5886ed2d7708b4981574..3cb235a9d58775166c57cb0f70878829a824dae8 100644
--- a/indra/cmake/Linking.cmake
+++ b/indra/cmake/Linking.cmake
@@ -69,22 +69,6 @@ if (WINDOWS)
       ole32
       dbghelp
       )
-
-  if(ASAN)
-    if(ADDRESS_SIZE EQUAL 32)
-      set(WINDOWS_LIBRARIES
-          ${WINDOWS_LIBRARIES}
-          clang_rt.asan_dynamic_runtime_thunk-i386
-          clang_rt.asan_dynamic-i386
-          )
-    else(ADDRESS_SIZE EQUAL 32)
-      set(WINDOWS_LIBRARIES
-          ${WINDOWS_LIBRARIES}
-          clang_rt.asan_dynamic_runtime_thunk-x86_64
-          clang_rt.asan_dynamic-x86_64
-          )
-    endif(ADDRESS_SIZE EQUAL 32)
-  endif(ASAN)
 else (WINDOWS)
   set(WINDOWS_LIBRARIES "")
 endif (WINDOWS)
diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake
index ddf9ef3839ab047b04036a7d98a365f98765e0df..ed595f6966c6af33e72b985fcdf0a60e7574f4b9 100644
--- a/indra/cmake/Python.cmake
+++ b/indra/cmake/Python.cmake
@@ -5,31 +5,22 @@ set(PYTHONINTERP_FOUND)
 if (WINDOWS)
   # On Windows, explicitly avoid Cygwin Python.
 
-  if (DEFINED ENV{VIRTUAL_ENV})
-    find_program(PYTHON_EXECUTABLE
-      NAMES python.exe
-      PATHS
-      "$ENV{VIRTUAL_ENV}\\scripts"
-      NO_DEFAULT_PATH
-      )
-  else()
-    find_program(PYTHON_EXECUTABLE
-      NAMES python.exe
-      NO_DEFAULT_PATH # added so that cmake does not find cygwin python
-      PATHS
-      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath]
-      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath]
-      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath]
-      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath]
-      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath]
-      [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath]
-      [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath]
-      [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath]
-      [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath]
-      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath]
-      )
-      include(FindPythonInterp)
-  endif()
+  find_program(PYTHON_EXECUTABLE
+    NAMES python.exe
+    NO_DEFAULT_PATH # added so that cmake does not find cygwin python
+    PATHS
+    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath]
+    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath]
+    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath]
+    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath]
+    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath]
+    [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath]
+    [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath]
+    [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath]
+    [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath]
+    [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath]
+    )
+    include(FindPythonInterp)
 else()
   find_program(PYTHON_EXECUTABLE python3)
 
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index e091ded349c803eff714a2257839b576d8f01dfc..919d2dabc4a1d75040e72f9c504ee0dfe9f5eb44 100644
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -1441,16 +1441,10 @@ namespace LLError
 		if (site.mLevel == LEVEL_ERROR)
 		{
 			g->mFatalMessage = message;
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-2.4
-#if !LL_RELEASE_FOR_DOWNLOAD && LL_WINDOWS
-			DebugBreak();
-#else
             if (s->mCrashFunction)
             {
                 s->mCrashFunction(message);
             }
-#endif // !LL_RELEASE_FOR_DOWNLOAD && LL_WINDOWS
-// [/SL:KB]
 		}
 	}
 }
diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h
index 6b17627944f12b18fdc9047904261c53a8e3eb1c..d06c0e21323711a6612b0a159e57d4f815b9ded8 100644
--- a/indra/llcommon/llerror.h
+++ b/indra/llcommon/llerror.h
@@ -384,24 +384,12 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG;
 #define LL_NEWLINE '\n'
 
 // Use this only in LL_ERRS or in a place that LL_ERRS may not be used
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-2.4
-#if !LL_RELEASE_FOR_DOWNLOAD
-#define LLERROR_CRASH         ;
-#else
 #define LLERROR_CRASH         \
 {                             \
     int* make_me_crash = NULL;\
     *make_me_crash = 0;       \
     exit(*make_me_crash);     \
 }
-#endif // !LL_RELEASE_FOR_DOWNLOAD
-// [/SL:KB]
-//#define LLERROR_CRASH         \
-//{                             \
-//    int* make_me_crash = NULL;\
-//    *make_me_crash = 0;       \
-//    exit(*make_me_crash);     \
-//}
 
 #define LL_ENDL                                         \
             LLError::End();                             \
diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h
index d4fde5fc6fe49d26d23bb3956ed5de0af30917da..24cb9bbce170d0f358f9e7ed3b2d5ca8eec1b38f 100644
--- a/indra/llcommon/llsd.h
+++ b/indra/llcommon/llsd.h
@@ -421,60 +421,42 @@ class LL_COMMON_API LLSD
 	static std::string		typeString(Type type);		// Return human-readable type as a string
 };
 
-//struct llsd_select_bool : public std::unary_function<LLSD, LLSD::Boolean>
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-struct llsd_select_bool
-// [/SL:KB]
+struct llsd_select_bool : public std::unary_function<LLSD, LLSD::Boolean>
 {
 	LLSD::Boolean operator()(const LLSD& sd) const
 	{
 		return sd.asBoolean();
 	}
 };
-//struct llsd_select_integer : public std::unary_function<LLSD, LLSD::Integer>
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-struct llsd_select_integer
-// [/SL:KB]
+struct llsd_select_integer : public std::unary_function<LLSD, LLSD::Integer>
 {
 	LLSD::Integer operator()(const LLSD& sd) const
 	{
 		return sd.asInteger();
 	}
 };
-//struct llsd_select_real : public std::unary_function<LLSD, LLSD::Real>
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-struct llsd_select_real
-// [/SL:KB]
+struct llsd_select_real : public std::unary_function<LLSD, LLSD::Real>
 {
 	LLSD::Real operator()(const LLSD& sd) const
 	{
 		return sd.asReal();
 	}
 };
-//struct llsd_select_float : public std::unary_function<LLSD, F32>
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-struct llsd_select_float
-// [/SL:KB]
+struct llsd_select_float : public std::unary_function<LLSD, F32>
 {
 	F32 operator()(const LLSD& sd) const
 	{
 		return (F32)sd.asReal();
 	}
 };
-//struct llsd_select_uuid : public std::unary_function<LLSD, LLSD::UUID>
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-struct llsd_select_uuid
-// [/SL:KB]
+struct llsd_select_uuid : public std::unary_function<LLSD, LLSD::UUID>
 {
 	LLSD::UUID operator()(const LLSD& sd) const
 	{
 		return sd.asUUID();
 	}
 };
-//struct llsd_select_string : public std::unary_function<LLSD, LLSD::String>
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-struct llsd_select_string
-// [/SL:KB]
+struct llsd_select_string : public std::unary_function<LLSD, LLSD::String>
 {
 	LLSD::String operator()(const LLSD& sd) const
 	{
diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h
index 2aed2d065bfbaf00112ed89d862a0581578ce983..a90c2c7e087a0593f1194662eff34b15c841aaef 100644
--- a/indra/llcommon/llstl.h
+++ b/indra/llcommon/llstl.h
@@ -141,39 +141,39 @@ struct DeletePairedPointerArray
 //          llcompose1(DeletePointerFunctor<widget>(),
 //                     llselect2nd<map_type::value_type>()));
 
-//template<typename T>
-//struct DeletePointerFunctor : public std::unary_function<T*, bool>
-//{
-//	bool operator()(T* ptr) const
-//	{
-//		delete ptr;
-//		return true;
-//	}
-//};
+template<typename T>
+struct DeletePointerFunctor : public std::unary_function<T*, bool>
+{
+	bool operator()(T* ptr) const
+	{
+		delete ptr;
+		return true;
+	}
+};
 
 // See notes about DeleteArray for why you should consider avoiding this.
-//template<typename T>
-//struct DeleteArrayFunctor : public std::unary_function<T*, bool>
-//{
-//	bool operator()(T* ptr) const
-//	{
-//		delete[] ptr;
-//		return true;
-//	}
-//};
+template<typename T>
+struct DeleteArrayFunctor : public std::unary_function<T*, bool>
+{
+	bool operator()(T* ptr) const
+	{
+		delete[] ptr;
+		return true;
+	}
+};
 
 // CopyNewPointer is a simple helper which accepts a pointer, and
 // returns a new pointer built with the copy constructor. Example:
 //
 //  transform(in.begin(), in.end(), out.end(), CopyNewPointer());
 
-//struct CopyNewPointer
-//{
-//	template<typename T> T* operator()(const T* ptr) const
-//	{
-//		return new T(*ptr);
-//	}
-//};
+struct CopyNewPointer
+{
+	template<typename T> T* operator()(const T* ptr) const
+	{
+		return new T(*ptr);
+	}
+};
 
 template<typename T, typename ALLOC>
 void delete_and_clear(std::list<T*, ALLOC>& list)
@@ -394,129 +394,129 @@ OutputIter ll_transform_n(
 // helper to deal with the fact that MSDev does not package
 // select... with the stl. Look up usage on the sgi website.
 
-//template <class _Pair>
-//struct _LLSelect1st : public std::unary_function<_Pair, typename _Pair::first_type> {
-//  const typename _Pair::first_type& operator()(const _Pair& __x) const {
-//    return __x.first;
-//  }
-//};
+template <class _Pair>
+struct _LLSelect1st : public std::unary_function<_Pair, typename _Pair::first_type> {
+  const typename _Pair::first_type& operator()(const _Pair& __x) const {
+    return __x.first;
+  }
+};
 
-//template <class _Pair>
-//struct _LLSelect2nd : public std::unary_function<_Pair, typename _Pair::second_type>
-//{
-//  const typename _Pair::second_type& operator()(const _Pair& __x) const {
-//    return __x.second;
-//  }
-//};
+template <class _Pair>
+struct _LLSelect2nd : public std::unary_function<_Pair, typename _Pair::second_type>
+{
+  const typename _Pair::second_type& operator()(const _Pair& __x) const {
+    return __x.second;
+  }
+};
 
-//template <class _Pair> struct llselect1st : public _LLSelect1st<_Pair> {};
-//template <class _Pair> struct llselect2nd : public _LLSelect2nd<_Pair> {};
+template <class _Pair> struct llselect1st : public _LLSelect1st<_Pair> {};
+template <class _Pair> struct llselect2nd : public _LLSelect2nd<_Pair> {};
 
 // helper to deal with the fact that MSDev does not package
 // compose... with the stl. Look up usage on the sgi website.
 
-//template <class _Operation1, class _Operation2>
-//class ll_unary_compose :
-//	public std::unary_function<typename _Operation2::argument_type,
-//							   typename _Operation1::result_type>
-//{
-//protected:
-//  _Operation1 __op1;
-//  _Operation2 __op2;
-//public:
-//  ll_unary_compose(const _Operation1& __x, const _Operation2& __y)
-//    : __op1(__x), __op2(__y) {}
-//  typename _Operation1::result_type
-//  operator()(const typename _Operation2::argument_type& __x) const {
-//    return __op1(__op2(__x));
-//  }
-//};
-
-//template <class _Operation1, class _Operation2>
-//inline ll_unary_compose<_Operation1,_Operation2>
-//llcompose1(const _Operation1& __op1, const _Operation2& __op2)
-//{
-//  return ll_unary_compose<_Operation1,_Operation2>(__op1, __op2);
-//}
-
-//template <class _Operation1, class _Operation2, class _Operation3>
-//class ll_binary_compose
-//  : public std::unary_function<typename _Operation2::argument_type,
-//							   typename _Operation1::result_type> {
-//protected:
-//  _Operation1 _M_op1;
-//  _Operation2 _M_op2;
-//  _Operation3 _M_op3;
-//public:
-//  ll_binary_compose(const _Operation1& __x, const _Operation2& __y,
-//					const _Operation3& __z)
-//    : _M_op1(__x), _M_op2(__y), _M_op3(__z) { }
-//  typename _Operation1::result_type
-//  operator()(const typename _Operation2::argument_type& __x) const {
-//    return _M_op1(_M_op2(__x), _M_op3(__x));
-//  }
-//};
+template <class _Operation1, class _Operation2>
+class ll_unary_compose :
+	public std::unary_function<typename _Operation2::argument_type,
+							   typename _Operation1::result_type>
+{
+protected:
+  _Operation1 __op1;
+  _Operation2 __op2;
+public:
+  ll_unary_compose(const _Operation1& __x, const _Operation2& __y)
+    : __op1(__x), __op2(__y) {}
+  typename _Operation1::result_type
+  operator()(const typename _Operation2::argument_type& __x) const {
+    return __op1(__op2(__x));
+  }
+};
 
-//template <class _Operation1, class _Operation2, class _Operation3>
-//inline ll_binary_compose<_Operation1, _Operation2, _Operation3>
-//llcompose2(const _Operation1& __op1, const _Operation2& __op2,
-//         const _Operation3& __op3)
-//{
-//  return ll_binary_compose<_Operation1,_Operation2,_Operation3>
-//    (__op1, __op2, __op3);
-//}
+template <class _Operation1, class _Operation2>
+inline ll_unary_compose<_Operation1,_Operation2>
+llcompose1(const _Operation1& __op1, const _Operation2& __op2)
+{
+  return ll_unary_compose<_Operation1,_Operation2>(__op1, __op2);
+}
+
+template <class _Operation1, class _Operation2, class _Operation3>
+class ll_binary_compose
+  : public std::unary_function<typename _Operation2::argument_type,
+							   typename _Operation1::result_type> {
+protected:
+  _Operation1 _M_op1;
+  _Operation2 _M_op2;
+  _Operation3 _M_op3;
+public:
+  ll_binary_compose(const _Operation1& __x, const _Operation2& __y,
+					const _Operation3& __z)
+    : _M_op1(__x), _M_op2(__y), _M_op3(__z) { }
+  typename _Operation1::result_type
+  operator()(const typename _Operation2::argument_type& __x) const {
+    return _M_op1(_M_op2(__x), _M_op3(__x));
+  }
+};
+
+template <class _Operation1, class _Operation2, class _Operation3>
+inline ll_binary_compose<_Operation1, _Operation2, _Operation3>
+llcompose2(const _Operation1& __op1, const _Operation2& __op2,
+         const _Operation3& __op3)
+{
+  return ll_binary_compose<_Operation1,_Operation2,_Operation3>
+    (__op1, __op2, __op3);
+}
 
 // helpers to deal with the fact that MSDev does not package
 // bind... with the stl. Again, this is from sgi.
-//template <class _Operation>
-//class llbinder1st :
-//	public std::unary_function<typename _Operation::second_argument_type,
-//							   typename _Operation::result_type> {
-//protected:
-//  _Operation op;
-//  typename _Operation::first_argument_type value;
-//public:
-//  llbinder1st(const _Operation& __x,
-//			  const typename _Operation::first_argument_type& __y)
-//      : op(__x), value(__y) {}
-//	typename _Operation::result_type
-//	operator()(const typename _Operation::second_argument_type& __x) const {
-//		return op(value, __x);
-//	}
-//};
-
-//template <class _Operation, class _Tp>
-//inline llbinder1st<_Operation>
-//llbind1st(const _Operation& __oper, const _Tp& __x)
-//{
-//  typedef typename _Operation::first_argument_type _Arg1_type;
-//  return llbinder1st<_Operation>(__oper, _Arg1_type(__x));
-//}
-
-//template <class _Operation>
-//class llbinder2nd
-//	: public std::unary_function<typename _Operation::first_argument_type,
-//								 typename _Operation::result_type> {
-//protected:
-//	_Operation op;
-//	typename _Operation::second_argument_type value;
-//public:
-//	llbinder2nd(const _Operation& __x,
-//				const typename _Operation::second_argument_type& __y)
-//		: op(__x), value(__y) {}
-//	typename _Operation::result_type
-//	operator()(const typename _Operation::first_argument_type& __x) const {
-//		return op(__x, value);
-//	}
-//};
-
-//template <class _Operation, class _Tp>
-//inline llbinder2nd<_Operation>
-//llbind2nd(const _Operation& __oper, const _Tp& __x)
-//{
-//  typedef typename _Operation::second_argument_type _Arg2_type;
-//  return llbinder2nd<_Operation>(__oper, _Arg2_type(__x));
-//}
+template <class _Operation>
+class llbinder1st :
+	public std::unary_function<typename _Operation::second_argument_type,
+							   typename _Operation::result_type> {
+protected:
+  _Operation op;
+  typename _Operation::first_argument_type value;
+public:
+  llbinder1st(const _Operation& __x,
+			  const typename _Operation::first_argument_type& __y)
+      : op(__x), value(__y) {}
+	typename _Operation::result_type
+	operator()(const typename _Operation::second_argument_type& __x) const {
+		return op(value, __x);
+	}
+};
+
+template <class _Operation, class _Tp>
+inline llbinder1st<_Operation>
+llbind1st(const _Operation& __oper, const _Tp& __x)
+{
+  typedef typename _Operation::first_argument_type _Arg1_type;
+  return llbinder1st<_Operation>(__oper, _Arg1_type(__x));
+}
+
+template <class _Operation>
+class llbinder2nd
+	: public std::unary_function<typename _Operation::first_argument_type,
+								 typename _Operation::result_type> {
+protected:
+	_Operation op;
+	typename _Operation::second_argument_type value;
+public:
+	llbinder2nd(const _Operation& __x,
+				const typename _Operation::second_argument_type& __y)
+		: op(__x), value(__y) {}
+	typename _Operation::result_type
+	operator()(const typename _Operation::first_argument_type& __x) const {
+		return op(__x, value);
+	}
+};
+
+template <class _Operation, class _Tp>
+inline llbinder2nd<_Operation>
+llbind2nd(const _Operation& __oper, const _Tp& __x)
+{
+  typedef typename _Operation::second_argument_type _Arg2_type;
+  return llbinder2nd<_Operation>(__oper, _Arg2_type(__x));
+}
 
 /**
  * Compare std::type_info* pointers a la std::less. We break this out as a
@@ -548,11 +548,8 @@ bool before(const std::type_info* lhs, const std::type_info* rhs)
 namespace std
 {
 	template <>
-//	struct less<const std::type_info*>:
-//		public std::binary_function<const std::type_info*, const std::type_info*, bool>
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-	struct less<const std::type_info*>
-// [/SL:KB]
+	struct less<const std::type_info*>:
+		public std::binary_function<const std::type_info*, const std::type_info*, bool>
 	{
 		bool operator()(const std::type_info* lhs, const std::type_info* rhs) const
 		{
@@ -561,11 +558,8 @@ namespace std
 	};
 
 	template <>
-//	struct less<std::type_info*>:
-//		public std::binary_function<std::type_info*, std::type_info*, bool>
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-	struct less<std::type_info*>
-// [/SL:KB]
+	struct less<std::type_info*>:
+		public std::binary_function<std::type_info*, std::type_info*, bool>
 	{
 		bool operator()(std::type_info* lhs, std::type_info* rhs) const
 		{
diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp
index 8dd550a2df655c4a573f79309eed4d60b80bcc74..e2469f3c7e651275c33b67c54138e04a0dba8526 100644
--- a/indra/llinventory/llparcel.cpp
+++ b/indra/llinventory/llparcel.cpp
@@ -1265,14 +1265,8 @@ void LLParcel::setExperienceKeyType( const LLUUID& experience_key, U32 type )
 
 U32 LLParcel::countExperienceKeyType( U32 type )
 {
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-    return std::count_if(
+	return std::count_if(
 		boost::begin(mExperienceKeys | boost::adaptors::map_values), 
 		boost::end(mExperienceKeys | boost::adaptors::map_values), 
-        [type](U32 v) { return v == type; });
-// [/SL:KB]
-//	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));
+		std::bind2nd(std::equal_to<U32>(), type));
 }
diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp
index 17c8dc63511d09ba101e330eb84901de48defd5e..8baa2e328b99d3157be5e25c185a72ceaf2086d7 100644
--- a/indra/llmessage/llcircuit.cpp
+++ b/indra/llmessage/llcircuit.cpp
@@ -437,16 +437,11 @@ LLCircuit::LLCircuit(const F32Seconds circuit_heartbeat_interval, const F32Secon
 LLCircuit::~LLCircuit()
 {
 	// delete pointers in the map.
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
 	std::for_each(mCircuitData.begin(),
 				  mCircuitData.end(),
-				  [](const circuit_data_map::value_type& x) { delete x.second;});
-// [/SL:KB]
-//	std::for_each(mCircuitData.begin(),
-//				  mCircuitData.end(),
-//				  llcompose1(
-//					  DeletePointerFunctor<LLCircuitData>(),
-//					  llselect2nd<circuit_data_map::value_type>()));
+				  llcompose1(
+					  DeletePointerFunctor<LLCircuitData>(),
+					  llselect2nd<circuit_data_map::value_type>()));
 }
 
 LLCircuitData *LLCircuit::addCircuitData(const LLHost &host, TPACKETID in_id)
diff --git a/indra/llmessage/lldispatcher.cpp b/indra/llmessage/lldispatcher.cpp
index f28833938430d86b4b14f09e1c44220e8002f737..717ef10f70283c1b319cf57a2fa381277fa3fbeb 100644
--- a/indra/llmessage/lldispatcher.cpp
+++ b/indra/llmessage/lldispatcher.cpp
@@ -58,18 +58,11 @@ bool LLDispatcher::isHandlerPresent(const key_t& name) const
 void LLDispatcher::copyAllHandlerNames(keys_t& names) const
 {
 	// copy the names onto the vector we are given
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-    std::transform(
-        mHandlers.begin(),
-        mHandlers.end(),
-        std::back_insert_iterator<keys_t>(names),
-        [](const dispatch_map_t::value_type& e) { return e.first; });
-// [/SL:KB]
-//	std::transform(
-//		mHandlers.begin(),
-//		mHandlers.end(),
-//		std::back_insert_iterator<keys_t>(names),
-//		llselect1st<dispatch_map_t::value_type>());
+	std::transform(
+		mHandlers.begin(),
+		mHandlers.end(),
+		std::back_insert_iterator<keys_t>(names),
+		llselect1st<dispatch_map_t::value_type>());
 }
 
 bool LLDispatcher::dispatch(
diff --git a/indra/llmessage/llmessagethrottle.cpp b/indra/llmessage/llmessagethrottle.cpp
index 59368630d47443b169b078230451f7525e2f5cf0..579d6d718788a0f43515ea6280ed1124cdb3ff8a 100644
--- a/indra/llmessage/llmessagethrottle.cpp
+++ b/indra/llmessage/llmessagethrottle.cpp
@@ -32,18 +32,18 @@
 #include "llframetimer.h"
 
 // This is used for the stl search_n function.
-//#if _MSC_VER >= 1500 // VC9 has a bug in search_n
-//struct eq_message_throttle_entry : public std::binary_function< LLMessageThrottleEntry, LLMessageThrottleEntry, bool >
-//{
-//	bool operator()(const LLMessageThrottleEntry& a, const LLMessageThrottleEntry& b) const
-//	{
-//		return a.getHash() == b.getHash();
-//	}
-//};
-//#else
-//bool eq_message_throttle_entry(LLMessageThrottleEntry a, LLMessageThrottleEntry b)
-// 		{ return a.getHash() == b.getHash(); }
-//#endif
+#if _MSC_VER >= 1500 // VC9 has a bug in search_n
+struct eq_message_throttle_entry : public std::binary_function< LLMessageThrottleEntry, LLMessageThrottleEntry, bool >
+{
+	bool operator()(const LLMessageThrottleEntry& a, const LLMessageThrottleEntry& b) const
+	{
+		return a.getHash() == b.getHash();
+	}
+};
+#else
+bool eq_message_throttle_entry(LLMessageThrottleEntry a, LLMessageThrottleEntry b)
+ 		{ return a.getHash() == b.getHash(); }
+#endif
 
 const U64 SEC_TO_USEC = 1000000;
 		
@@ -118,18 +118,14 @@ BOOL LLMessageThrottle::addViewerAlert(const LLUUID& to, const std::string& mesg
 	LLMessageThrottleEntry entry(hash, LLFrameTimer::getTotalTime());
 
 	// Check if this message is already in the list.
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
+#if _MSC_VER >= 1500 // VC9 has a bug in search_n
+	// SJB: This *should* work but has not been tested yet *TODO: Test!
 	message_list_iterator_t found = std::find_if(message_list->begin(), message_list->end(),
-												 [&entry](const message_list_t::value_type& e) { return e.getHash() == entry.getHash(); });
-// [/SL:KB]
-//#if _MSC_VER >= 1500 // VC9 has a bug in search_n
-//	// SJB: This *should* work but has not been tested yet *TODO: Test!
-//	message_list_iterator_t found = std::find_if(message_list->begin(), message_list->end(),
-//												 std::bind2nd(eq_message_throttle_entry(), entry));
-//#else
-// 	message_list_iterator_t found = std::search_n(message_list->begin(), message_list->end(),
-// 												  1, entry, eq_message_throttle_entry);
-//#endif
+												 std::bind2nd(eq_message_throttle_entry(), entry));
+#else
+ 	message_list_iterator_t found = std::search_n(message_list->begin(), message_list->end(),
+ 												  1, entry, eq_message_throttle_entry);
+#endif
 	if (found == message_list->end())
 	{
 		// This message was not found.  Add it to the list.
@@ -156,18 +152,14 @@ BOOL LLMessageThrottle::addAgentAlert(const LLUUID& agent, const LLUUID& task, c
 	LLMessageThrottleEntry entry(hash, LLFrameTimer::getTotalTime());
 
 	// Check if this message is already in the list.
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
+#if _MSC_VER >= 1500 // VC9 has a bug in search_n
+	// SJB: This *should* work but has not been tested yet *TODO: Test!
 	message_list_iterator_t found = std::find_if(message_list->begin(), message_list->end(),
-												 [&entry](const message_list_t::value_type& e) { return e.getHash() == entry.getHash(); });
-// [/SL:KB]
-//#if _MSC_VER >= 1500 // VC9 has a bug in search_n
-//	// SJB: This *should* work but has not been tested yet *TODO: Test!
-//	message_list_iterator_t found = std::find_if(message_list->begin(), message_list->end(),
-//												 std::bind2nd(eq_message_throttle_entry(), entry));
-//#else
-//	message_list_iterator_t found = std::search_n(message_list->begin(), message_list->end(),
-//												  1, entry, eq_message_throttle_entry);
-//#endif
+												 std::bind2nd(eq_message_throttle_entry(), entry));
+#else
+	message_list_iterator_t found = std::search_n(message_list->begin(), message_list->end(),
+												  1, entry, eq_message_throttle_entry);
+#endif
 	
 	if (found == message_list->end())
 	{
diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h
index c2215037c26171a35c478fa4d5d86268a615beb8..89c9852f4af3349fe8e3f4bd53ea889205954c15 100644
--- a/indra/llui/lldockablefloater.h
+++ b/indra/llui/lldockablefloater.h
@@ -131,10 +131,7 @@ class LLDockableFloater : public LLFloater
 	boost::function<BOOL ()> mIsDockedStateForcedCallback;
 
 private:
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-	std::unique_ptr<LLDockControl> mDockControl;
-// [/SL:KB]
-//	std::auto_ptr<LLDockControl> mDockControl;
+	std::auto_ptr<LLDockControl> mDockControl;
 	LLUIImagePtr mDockTongue;
 	static LLHandle<LLFloater> sInstanceHandle;
 	/**
diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt
index 528d8c80e38d0dc2b7629e540a67cb7e7528a425..eb067a7f6e56a204c59b8f0a2a1d07cbdbc5b7cb 100644
--- a/indra/media_plugins/example/CMakeLists.txt
+++ b/indra/media_plugins/example/CMakeLists.txt
@@ -69,7 +69,7 @@ if (WINDOWS)
   set_target_properties(
     media_plugin_example
     PROPERTIES
-    LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /LTCG /NODEFAULTLIB:LIBCMT /IGNORE:4099"
+    LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /LTCG /NODEFAULTLIB:LIBCMT"
     )
 endif (WINDOWS)
 
diff --git a/indra/media_plugins/libvlc/CMakeLists.txt b/indra/media_plugins/libvlc/CMakeLists.txt
index 624bfac119599d0eab4ca695523eb800d650f920..97392bbe089f960db59ab3f374d4082df80209d1 100644
--- a/indra/media_plugins/libvlc/CMakeLists.txt
+++ b/indra/media_plugins/libvlc/CMakeLists.txt
@@ -78,7 +78,7 @@ if (WINDOWS)
   set_target_properties(
     media_plugin_libvlc
     PROPERTIES
-    LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099"
+    LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT"
     )
 endif (WINDOWS)
 
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 0e19172496679e01146cdc147bc0cb89a142c6e3..18e94049728b285947e4f09a1697af1aca552f9c 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1811,7 +1811,7 @@ if (WINDOWS)
         # *TODO -reenable this once we get server usage sorted out
         LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /LARGEADDRESSAWARE"
         LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO /LARGEADDRESSAWARE"
-        LINK_FLAGS_RELEASE "/MAP\"secondlife-bin.MAP\" /OPT:REF /LARGEADDRESSAWARE"
+        LINK_FLAGS_RELEASE "/FORCE:MULTIPLE /MAP\"secondlife-bin.MAP\" /OPT:REF /LARGEADDRESSAWARE"
         )
 
     if(USE_PRECOMPILED_HEADERS)
@@ -1838,39 +1838,35 @@ if (WINDOWS)
       # The following commented dependencies are determined at variably at build time. Can't do this here.
       ${CMAKE_SOURCE_DIR}/../etc/message.xml
       ${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg
-      #${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/llcommon.dll
+      ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/llcommon.dll
       ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libapr-1.dll
       ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libaprutil-1.dll
       ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libapriconv-1.dll
-      #${SHARED_LIB_STAGING_DIR}/Release/libcollada14dom22.dll
-      #${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libcollada14dom22.dll
-      #${SHARED_LIB_STAGING_DIR}/Debug/libcollada14dom22-d.dll
-      ${SHARED_LIB_STAGING_DIR}/Release/nghttp2.dll
-      ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/nghttp2.dll
-      ${SHARED_LIB_STAGING_DIR}/Release/msvcp140.dll
-      ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/msvcp140.dll
+      ${SHARED_LIB_STAGING_DIR}/Release/libcollada14dom22.dll
+      ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libcollada14dom22.dll
+      ${SHARED_LIB_STAGING_DIR}/Debug/libcollada14dom22-d.dll
       ${SHARED_LIB_STAGING_DIR}/Release/openjpeg.dll
       ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/openjpeg.dll
-      #${SHARED_LIB_STAGING_DIR}/Debug/openjpegd.dll
+      ${SHARED_LIB_STAGING_DIR}/Debug/openjpegd.dll
       ${SHARED_LIB_STAGING_DIR}/Release/libhunspell.dll
       ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libhunspell.dll
-      #${SHARED_LIB_STAGING_DIR}/Debug/libhunspell.dll
+      ${SHARED_LIB_STAGING_DIR}/Debug/libhunspell.dll
       ${SHARED_LIB_STAGING_DIR}/Release/uriparser.dll
       ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/uriparser.dll
       ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/SLVoice.exe
-      #${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libsndfile-1.dll
-      #${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/vivoxoal.dll
+      ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libsndfile-1.dll
+      ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/vivoxoal.dll
       ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/ca-bundle.crt
       ${GOOGLE_PERF_TOOLS_SOURCE}
       ${CMAKE_CURRENT_SOURCE_DIR}/licenses-win32.txt
-      #${CMAKE_CURRENT_SOURCE_DIR}/featuretable.txt
-      #${CMAKE_CURRENT_SOURCE_DIR}/featuretable_xp.txt
+      ${CMAKE_CURRENT_SOURCE_DIR}/featuretable.txt
+      ${CMAKE_CURRENT_SOURCE_DIR}/featuretable_xp.txt
       ${viewer_APPSETTINGS_FILES}
       SLPlugin
       media_plugin_cef
       media_plugin_libvlc
       media_plugin_example
-      #winmm_shim
+      winmm_shim
       )
 
     if (NOT USE_BUGSPLAT)
@@ -1897,7 +1893,7 @@ if (WINDOWS)
       list(APPEND COPY_INPUT_DEPENDENCIES
            ${SHARED_LIB_STAGING_DIR}/Release/fmod.dll
            ${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/fmod.dll
-           #${SHARED_LIB_STAGING_DIR}/Debug/fmodL.dll
+           ${SHARED_LIB_STAGING_DIR}/Debug/fmodL.dll
           )
     endif (FMODSTUDIO)
 
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 626dfa4b48fb7a6f5cea2dded1da4e2b9878b18e..32108163f564db8dd0ec4594aa62e00f8ba0cc12 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -298,10 +298,7 @@ class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr>
 	
 	LLUUID mCOFImageID;
 
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-	std::unique_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
-// [/SL:KB]
-//	std::auto_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
+	std::auto_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 368607aeb72380eda088739cdb78a5908901bc8f..c13b63433c42f760964d891e5429d378ae7443f3 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -840,11 +840,8 @@ void LLFavoritesBarCtrl::updateButtons(bool force_update)
 		if (getChildList()->size() > 0)
 		{
 			//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));
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-			child_list_const_reverse_iter_t last_visible_it = std::find_if(childs->rbegin(), childs->rend(), [](const LLView* viewp) { return viewp->getVisible(); });
-// [/SL:KB]
+			child_list_const_reverse_iter_t last_visible_it = std::find_if(childs->rbegin(), childs->rend(), 
+					std::mem_fun(&LLView::getVisible));
 			if(last_visible_it != childs->rend())
 			{
 				last_right_edge = (*last_visible_it)->getRect().mRight;
diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp
index 074ffabf11d872db57330d1eae3ac748c432ac1f..ffbb0bbee9a062c9af631e0937e9b69192289feb 100644
--- a/indra/newview/llfloater360capture.cpp
+++ b/indra/newview/llfloater360capture.cpp
@@ -889,10 +889,7 @@ const std::string LLFloater360Capture::generate_proposed_filename()
         // this looks complex but it's straightforward - removes all non-alpha chars from a string
         // which in this case is the SL region name - we use it as a proposed filename but the user is free to change
         std::string region_name = region->getName();
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-        std::replace_if(region_name.begin(), region_name.end(), [](unsigned char ch) { return !isalnum(ch); }, '_');
-// [/SL:KB]
-//        std::replace_if(region_name.begin(), region_name.end(), std::not1(std::ptr_fun(isalnum)), '_');
+        std::replace_if(region_name.begin(), region_name.end(), std::not1(std::ptr_fun(isalnum)), '_');
         if (region_name.length() > 0)
         {
             filename << region_name;
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index f2aebe33463113b994a0a69d0e500f20be390936..19080f05c062ea408597861b93fad2941771deb3 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -656,18 +656,12 @@ void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region)
 	}
 
 	// call refresh from region on all panels
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
 	std::for_each(
 		mInfoPanels.begin(),
 		mInfoPanels.end(),
-		[region](LLPanelRegionInfo* panelp) { panelp->refreshFromRegion(region); });
-// [/SL:KB]
-//	std::for_each(
-//		mInfoPanels.begin(),
-//		mInfoPanels.end(),
-//		llbind2nd(
-//			std::mem_fun(&LLPanelRegionInfo::refreshFromRegion),
-//			region));
+		llbind2nd(
+			std::mem_fun(&LLPanelRegionInfo::refreshFromRegion),
+			region));
     mEnvironmentPanel->refreshFromRegion(region);
 }
 
diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp
index cc768885cd285d8dd73b1fd6e41215f89b38adda..4480fa6404adbe82ead0b7b028c6a0a972546099 100644
--- a/indra/newview/llgesturemgr.cpp
+++ b/indra/newview/llgesturemgr.cpp
@@ -766,10 +766,7 @@ S32 LLGestureMgr::getPlayingCount() const
 }
 
 
-//struct IsGesturePlaying : public std::unary_function<LLMultiGesture*, bool>
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznîp-6.6
-struct IsGesturePlaying
-// [/SL:KB]
+struct IsGesturePlaying : public std::unary_function<LLMultiGesture*, bool>
 {
 	bool operator()(const LLMultiGesture* gesture) const
 	{
diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h
index 44e7132848fe565882fa9b55440a017548343d14..69074b1670548593f16f5a058eb1805d1c9ba1ea 100644
--- a/indra/newview/lltoast.h
+++ b/indra/newview/lltoast.h
@@ -222,10 +222,7 @@ class LLToast : public LLModalDialog, public LLInstanceTracker<LLToast>
 	LLPanel*	 mWrapperPanel;
 
 	// timer counts a lifetime of a toast
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-	std::unique_ptr<LLToastLifeTimer> mTimer;
-// [/SL:KB]
-//	std::auto_ptr<LLToastLifeTimer> mTimer;
+	std::auto_ptr<LLToastLifeTimer> mTimer;
 
 	F32			mToastLifetime; // in seconds
 	F32			mToastFadingTime; // in seconds
diff --git a/indra/newview/llwatchdog.cpp b/indra/newview/llwatchdog.cpp
index 066a4c428dbdb3c02ac11363199491e970a6f929..0aa0280b25720b304c00ad249e4be4de8bfd9f70 100644
--- a/indra/newview/llwatchdog.cpp
+++ b/indra/newview/llwatchdog.cpp
@@ -222,31 +222,18 @@ void LLWatchdog::run()
 	if(current_run_delta > (WATCHDOG_SLEEP_TIME_USEC * TIME_ELAPSED_MULTIPLIER))
 	{
 		LL_INFOS() << "Watchdog thread delayed: resetting entries." << LL_ENDL;
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
 		std::for_each(mSuspects.begin(), 
 			mSuspects.end(), 
-			std::mem_fn(&LLWatchdogEntry::reset)
+			std::mem_fun(&LLWatchdogEntry::reset)
 			);
-// [/SL:KB]
-//		std::for_each(mSuspects.begin(), 
-//			mSuspects.end(), 
-//			std::mem_fun(&LLWatchdogEntry::reset)
-//			);
 	}
 	else
 	{
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
 		SuspectsRegistry::iterator result = 
 			std::find_if(mSuspects.begin(), 
 				mSuspects.end(), 
-				std::not1(std::mem_fn(&LLWatchdogEntry::isAlive))
+				std::not1(std::mem_fun(&LLWatchdogEntry::isAlive))
 				);
-// [/SL:KB]
-//		SuspectsRegistry::iterator result = 
-//			std::find_if(mSuspects.begin(), 
-//				mSuspects.end(), 
-//				std::not1(std::mem_fun(&LLWatchdogEntry::isAlive))
-//				);
 		if(result != mSuspects.end())
 		{
 			// error!!!
diff --git a/indra/test/lldoubledispatch_tut.cpp b/indra/test/lldoubledispatch_tut.cpp
index 4732fa9a57992c77f5429e8341ad16c5cd2b2a03..ad8f6454d4caa5604a1e7a96f7eb1377b914f8f1 100644
--- a/indra/test/lldoubledispatch_tut.cpp
+++ b/indra/test/lldoubledispatch_tut.cpp
@@ -135,16 +135,10 @@ namespace tut
 
         // Instantiate a few GameObjects.  Make sure we refer to them
         // polymorphically, and don't let them leak.
-// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
-        std::unique_ptr<GameObject> home;
-        std::unique_ptr<GameObject> obstacle;
-        std::unique_ptr<GameObject> tug;
-        std::unique_ptr<GameObject> patrol;
-// [/SL:KB]
-//        std::auto_ptr<GameObject> home;
-//        std::auto_ptr<GameObject> obstacle;
-//        std::auto_ptr<GameObject> tug;
-//        std::auto_ptr<GameObject> patrol;
+        std::auto_ptr<GameObject> home;
+        std::auto_ptr<GameObject> obstacle;
+        std::auto_ptr<GameObject> tug;
+        std::auto_ptr<GameObject> patrol;
 
         // prototype objects
         Asteroid dummyAsteroid;