From 7caef4bc6c348a4aad4a777df0d1ea34ab13ff00 Mon Sep 17 00:00:00 2001
From: Monty Brandenberg <monty@lindenlab.com>
Date: Tue, 8 May 2012 10:38:08 -0400
Subject: Okay, got Mac building with Boost 1.48.  Unit tests needed NULL
 pointer defenses in the delete functions of the allocation support.  General
 boost library renaming again.  Linux builds in TC though it shouldn't based
 on what Boost.cmake lookes like...

---
 indra/cmake/Boost.cmake                    | 31 ++++++++++++++++++++++++------
 indra/llcorehttp/CMakeLists.txt            |  2 --
 indra/llcorehttp/tests/llcorehttp_test.cpp |  6 ++++--
 indra/llcorehttp/tests/test_allocator.cpp  | 10 ++++++++--
 4 files changed, 37 insertions(+), 12 deletions(-)

diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake
index 24de1fc0c2..4a797d968a 100644
--- a/indra/cmake/Boost.cmake
+++ b/indra/cmake/Boost.cmake
@@ -53,11 +53,30 @@ else (STANDALONE)
           optimized libboost_thread-mt
           debug libboost_thread-mt-gd)
     endif (MSVC80)
-  elseif (DARWIN OR LINUX)
-    set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options)
-    set(BOOST_REGEX_LIBRARY boost_regex)
-    set(BOOST_SYSTEM_LIBRARY boost_system)
-    set(BOOST_FILESYSTEM_LIBRARY boost_filesystem)
-    set(BOOST_THREAD_LIBRARY boost_thread)
+  elseif (LINUX)
+    set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
+    set(BOOST_REGEX_LIBRARY boost_regex-mt)
+    set(BOOST_SYSTEM_LIBRARY boost_system-mt)
+    set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
+    set(BOOST_THREAD_LIBRARY boost_thread-mt)
+  elseif (DARWIN)
+    set(BOOST_PROGRAM_OPTIONS_LIBRARY
+        optimized boost_program_options-mt
+        debug boost_program_options-mt-d)
+    set(BOOST_PROGRAM_OPTIONS_LIBRARY
+        optimized boost_program_options-mt
+        debug boost_program_options-mt-d)
+    set(BOOST_REGEX_LIBRARY
+        optimized boost_regex-mt
+        debug boost_regex-mt-d)
+    set(BOOST_SYSTEM_LIBRARY
+        optimized boost_system-mt
+        debug boost_system-mt-d)
+    set(BOOST_FILESYSTEM_LIBRARY
+        optimized boost_filesystem-mt
+        debug boost_filesystem-mt-d)
+    set(BOOST_THREAD_LIBRARY
+        optimized boost_thread-mt
+        debug boost_thread-mt-d)
   endif (WINDOWS)
 endif (STANDALONE)
diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt
index a950e9180c..99b60a5995 100644
--- a/indra/llcorehttp/CMakeLists.txt
+++ b/indra/llcorehttp/CMakeLists.txt
@@ -78,7 +78,6 @@ target_link_libraries(
 
 # tests
 if (LL_TESTS)
-#if (LL_TESTS AND 0)
   SET(llcorehttp_TEST_SOURCE_FILES
       tests/test_allocator.cpp
       )
@@ -117,5 +116,4 @@ if (LL_TESTS)
                           )
 
 endif (LL_TESTS)
-#endif (LL_TESTS AND 0)
 
diff --git a/indra/llcorehttp/tests/llcorehttp_test.cpp b/indra/llcorehttp/tests/llcorehttp_test.cpp
index ad596d61cc..92f16be8fd 100644
--- a/indra/llcorehttp/tests/llcorehttp_test.cpp
+++ b/indra/llcorehttp/tests/llcorehttp_test.cpp
@@ -27,8 +27,10 @@
 
 #include <iostream>
 
-#include <tut/tut.hpp>
-#include <tut/tut_reporter.hpp>
+// These are not the right way in viewer for some reason:
+// #include <tut/tut.hpp>
+// #include <tut/tut_reporter.hpp>
+#include "../test/lltut.h"
 
 #include <curl/curl.h>
 
diff --git a/indra/llcorehttp/tests/test_allocator.cpp b/indra/llcorehttp/tests/test_allocator.cpp
index 926de0a208..ea12dc58eb 100644
--- a/indra/llcorehttp/tests/test_allocator.cpp
+++ b/indra/llcorehttp/tests/test_allocator.cpp
@@ -166,13 +166,19 @@ void * operator new[](std::size_t size) THROW_BAD_ALLOC()
 
 void operator delete(void * p) THROW_NOTHING()
 {
-	FreeMem( p );
+	if (p)
+	{
+		FreeMem( p );
+	}
 }
 
 
 void operator delete[](void * p) THROW_NOTHING()
 {
-	FreeMem( p );
+	if (p)
+	{
+		FreeMem( p );
+	}
 }
 
 
-- 
cgit v1.2.3