summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2011-05-17 19:21:55 +0000
committerDon Kjer <don@lindenlab.com>2011-05-17 19:21:55 +0000
commitae8ed3fc2d4a7dda92ad8fdb34bc559478eb9177 (patch)
tree64cd5d3328dbb56b03a03cf873a613005d0394dc /indra/llcommon
parentc62ef53863bd01cb96de55e0250c8a8193b6c72b (diff)
parent113f532ee57eeeca4dc7eb6ca05f923f1f3543d3 (diff)
Merge with viewer-development
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/CMakeLists.txt13
-rw-r--r--indra/llcommon/indra_constants.h8
-rw-r--r--indra/llcommon/llapp.cpp7
-rw-r--r--indra/llcommon/llsys.cpp62
-rw-r--r--indra/llcommon/llversionviewer.h2
5 files changed, 76 insertions, 16 deletions
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 22e0705036..80df91a5c1 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -7,7 +7,6 @@ include(00-Common)
include(LLCommon)
include(Linking)
include(Boost)
-include(Pth)
include(LLSharedLibs)
include(GoogleBreakpad)
include(GooglePerfTools)
@@ -18,7 +17,6 @@ include_directories(
${EXPAT_INCLUDE_DIRS}
${LLCOMMON_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
- ${PTH_INCLUDE_DIRS}
)
# add_executable(lltreeiterators lltreeiterators.cpp)
@@ -268,6 +266,10 @@ if(LLCOMMON_LINK_SHARED)
add_definitions(-fPIC)
endif(WINDOWS)
endif(NOT WORD_SIZE EQUAL 32)
+ if(WINDOWS)
+ # always generate llcommon.pdb, even for "Release" builds
+ set_target_properties(llcommon PROPERTIES LINK_FLAGS "/DEBUG")
+ endif(WINDOWS)
ll_stage_sharedlib(llcommon)
else(LLCOMMON_LINK_SHARED)
add_library (llcommon ${llcommon_SOURCE_FILES})
@@ -283,10 +285,15 @@ target_link_libraries(
${WINDOWS_LIBRARIES}
${BOOST_PROGRAM_OPTIONS_LIBRARY}
${BOOST_REGEX_LIBRARY}
- ${PTH_LIBRARIES}
${GOOGLE_PERFTOOLS_LIBRARIES}
)
+if (DARWIN)
+ include(CMakeFindFrameworks)
+ find_library(CARBON_LIBRARY Carbon)
+ target_link_libraries(llcommon ${CARBON_LIBRARY})
+endif (DARWIN)
+
add_dependencies(llcommon stage_third_party_libs)
if (LL_TESTS)
diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h
index 95cb606240..d0f287657e 100644
--- a/indra/llcommon/indra_constants.h
+++ b/indra/llcommon/indra_constants.h
@@ -312,6 +312,14 @@ const F32 CHAT_SHOUT_RADIUS = 100.f;
const F32 CHAT_MAX_RADIUS = CHAT_SHOUT_RADIUS;
const F32 CHAT_MAX_RADIUS_BY_TWO = CHAT_MAX_RADIUS / 2.f;
+// squared editions of the above for distance checks
+const F32 CHAT_WHISPER_RADIUS_SQUARED = CHAT_WHISPER_RADIUS * CHAT_WHISPER_RADIUS;
+const F32 CHAT_NORMAL_RADIUS_SQUARED = CHAT_NORMAL_RADIUS * CHAT_NORMAL_RADIUS;
+const F32 CHAT_SHOUT_RADIUS_SQUARED = CHAT_SHOUT_RADIUS * CHAT_SHOUT_RADIUS;
+const F32 CHAT_MAX_RADIUS_SQUARED = CHAT_SHOUT_RADIUS_SQUARED;
+const F32 CHAT_MAX_RADIUS_BY_TWO_SQUARED = CHAT_MAX_RADIUS_BY_TWO * CHAT_MAX_RADIUS_BY_TWO;
+
+
// this times above gives barely audible radius
const F32 CHAT_BARELY_AUDIBLE_FACTOR = 2.0f;
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index 39daefd1ad..ed192a9975 100644
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -24,6 +24,10 @@
* $/LicenseInfo$
*/
+#include "linden_common.h"
+
+#include "llapp.h"
+
#include <cstdlib>
#ifdef LL_DARWIN
@@ -32,9 +36,6 @@
#include <sys/sysctl.h>
#endif
-#include "linden_common.h"
-#include "llapp.h"
-
#include "llcommon.h"
#include "llapr.h"
#include "llerrorcontrol.h"
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 10cdc7087b..ca2d3f9181 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -46,6 +46,7 @@
# include <sys/sysctl.h>
# include <sys/utsname.h>
# include <stdint.h>
+# include <Carbon/Carbon.h>
#elif LL_LINUX
# include <errno.h>
# include <sys/utsname.h>
@@ -318,7 +319,58 @@ LLOSInfo::LLOSInfo() :
}
mOSString += compatibility_mode;
+#elif LL_DARWIN
+
+ // Initialize mOSStringSimple to something like:
+ // "Mac OS X 10.6.7"
+ {
+ const char * DARWIN_PRODUCT_NAME = "Mac OS X";
+
+ SInt32 major_version, minor_version, bugfix_version;
+ OSErr r1 = Gestalt(gestaltSystemVersionMajor, &major_version);
+ OSErr r2 = Gestalt(gestaltSystemVersionMinor, &minor_version);
+ OSErr r3 = Gestalt(gestaltSystemVersionBugFix, &bugfix_version);
+
+ if((r1 == noErr) && (r2 == noErr) && (r3 == noErr))
+ {
+ mMajorVer = major_version;
+ mMinorVer = minor_version;
+ mBuild = bugfix_version;
+
+ std::stringstream os_version_string;
+ os_version_string << DARWIN_PRODUCT_NAME << " " << mMajorVer << "." << mMinorVer << "." << mBuild;
+
+ // Put it in the OS string we are compiling
+ mOSStringSimple.append(os_version_string.str());
+ }
+ else
+ {
+ mOSStringSimple.append("Unable to collect OS info");
+ }
+ }
+
+ // Initialize mOSString to something like:
+ // "Mac OS X 10.6.7 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386"
+ struct utsname un;
+ if(uname(&un) != -1)
+ {
+ mOSString = mOSStringSimple;
+ mOSString.append(" ");
+ mOSString.append(un.sysname);
+ mOSString.append(" ");
+ mOSString.append(un.release);
+ mOSString.append(" ");
+ mOSString.append(un.version);
+ mOSString.append(" ");
+ mOSString.append(un.machine);
+ }
+ else
+ {
+ mOSString = mOSStringSimple;
+ }
+
#else
+
struct utsname un;
if(uname(&un) != -1)
{
@@ -334,15 +386,7 @@ LLOSInfo::LLOSInfo() :
// Simplify 'Simple'
std::string ostype = mOSStringSimple.substr(0, mOSStringSimple.find_first_of(" ", 0));
- if (ostype == "Darwin")
- {
- // Only care about major Darwin versions, truncate at first '.'
- S32 idx1 = mOSStringSimple.find_first_of(".", 0);
- std::string simple = mOSStringSimple.substr(0, idx1);
- if (simple.length() > 0)
- mOSStringSimple = simple;
- }
- else if (ostype == "Linux")
+ if (ostype == "Linux")
{
// Only care about major and minor Linux versions, truncate at second '.'
std::string::size_type idx1 = mOSStringSimple.find_first_of(".", 0);
diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index 58f96df8ab..79124a5a37 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -29,7 +29,7 @@
const S32 LL_VERSION_MAJOR = 2;
const S32 LL_VERSION_MINOR = 6;
-const S32 LL_VERSION_PATCH = 7;
+const S32 LL_VERSION_PATCH = 9;
const S32 LL_VERSION_BUILD = 0;
const char * const LL_CHANNEL = "Second Life Developer";