diff options
author | Ptolemy <ptolemy@lindenlab.com> | 2022-06-29 14:00:50 -0700 |
---|---|---|
committer | Ptolemy <ptolemy@lindenlab.com> | 2022-06-29 14:00:50 -0700 |
commit | 36fd0f7ca932cce5cd3614c16cd26aceedf57952 (patch) | |
tree | ada1b461d97bf75b016a13bbc30c070ee74a1183 /indra/llcommon/llsys.cpp | |
parent | 78e3edba6e998d8e97a1bff952073f62e58fd379 (diff) | |
parent | 069304ca394d4d6069f00bb976f2d75e82bf675c (diff) |
Merge branch 'DRTVWR-559' of bitbucket.org:lindenlab/viewer into DRTVWR-559
Diffstat (limited to 'indra/llcommon/llsys.cpp')
-rw-r--r-- | indra/llcommon/llsys.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index f717b2cf34..9b6bb3826c 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -36,7 +36,7 @@ #ifdef LL_USESYSTEMLIBS # include <zlib.h> #else -# include "zlib/zlib.h" +# include "zlib-ng/zlib.h" #endif #include "llprocessor.h" @@ -456,6 +456,8 @@ LLOSInfo::LLOSInfo() : dotted_version_string << mMajorVer << "." << mMinorVer << "." << mBuild; mOSVersionString.append(dotted_version_string.str()); + mOSBitness = is64Bit() ? 64 : 32; + LL_INFOS("LLOSInfo") << "OS bitness: " << mOSBitness << LL_ENDL; } #ifndef LL_WINDOWS @@ -511,6 +513,11 @@ const std::string& LLOSInfo::getOSVersionString() const return mOSVersionString; } +const S32 LLOSInfo::getOSBitness() const +{ + return mOSBitness; +} + //static U32 LLOSInfo::getProcessVirtualSizeKB() { @@ -564,6 +571,25 @@ U32 LLOSInfo::getProcessResidentSizeKB() return resident_size; } +//static +bool LLOSInfo::is64Bit() +{ +#if LL_WINDOWS +#if defined(_WIN64) + return true; +#elif defined(_WIN32) + // 32-bit viewer may be run on both 32-bit and 64-bit Windows, need to elaborate + BOOL f64 = FALSE; + return IsWow64Process(GetCurrentProcess(), &f64) && f64; +#else + return false; +#endif +#else // ! LL_WINDOWS + // we only build a 64-bit mac viewer and currently we don't build for linux at all + return true; +#endif +} + LLCPUInfo::LLCPUInfo() { std::ostringstream out; |