summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2021-05-14 10:36:29 -0400
committerNat Goodspeed <nat@lindenlab.com>2021-05-14 10:36:29 -0400
commit1eeb4c85a120b23b853aabb8e6cf984b03dbc17f (patch)
treea06afabe8c4f7067a4e2604adcd83a3c29d091f7 /indra
parentd3d8203be4aec8ad90c0044e3a0ade1d91df64ea (diff)
SL-15258: No 'using namespace std' with Windows SDK
With /std:c++17, in wbemcli.h included by <Wbemidl.h>, we were getting errors concerning an ambiguous symbol 'byte'. This turns out to be due to a 'using namespace std' declaration before the #include. The linked workaround advises moving 'using namespace std' after the #include. But since the ONLY symbol from std that was used without qualification was 'hex' in a few places, remove 'using namespace std' altogether and just write 'std::hex' everywhere. https://developercommunity.visualstudio.com/t/error-c2872-byte-ambiguous-symbol/93889#T-N138537
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llmachineid.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp
index 57a6ecb604..1810105b42 100644
--- a/indra/newview/llmachineid.cpp
+++ b/indra/newview/llmachineid.cpp
@@ -30,7 +30,6 @@
#if LL_WINDOWS
#define _WIN32_DCOM
#include <iostream>
-using namespace std;
#include <comdef.h>
#include <Wbemidl.h>
#endif
@@ -47,7 +46,7 @@ public:
{
mHR = CoInitializeEx(0, COINIT_MULTITHREADED);
if (FAILED(mHR))
- LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << hex << mHR << LL_ENDL;
+ LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << std::hex << mHR << LL_ENDL;
}
~LLComInitialize()
@@ -105,7 +104,7 @@ S32 LLMachineID::init()
if (FAILED(hres))
{
- LL_WARNS("AppInit") << "Failed to initialize security. Error code = 0x" << hex << hres << LL_ENDL;
+ LL_WARNS("AppInit") << "Failed to initialize security. Error code = 0x" << std::hex << hres << LL_ENDL;
return 1; // Program has failed.
}
@@ -122,7 +121,7 @@ S32 LLMachineID::init()
if (FAILED(hres))
{
- LL_WARNS("AppInit") << "Failed to create IWbemLocator object." << " Err code = 0x" << hex << hres << LL_ENDL;
+ LL_WARNS("AppInit") << "Failed to create IWbemLocator object." << " Err code = 0x" << std::hex << hres << LL_ENDL;
return 1; // Program has failed.
}
@@ -147,7 +146,7 @@ S32 LLMachineID::init()
if (FAILED(hres))
{
- LL_WARNS("AppInit") << "Could not connect. Error code = 0x" << hex << hres << LL_ENDL;
+ LL_WARNS("AppInit") << "Could not connect. Error code = 0x" << std::hex << hres << LL_ENDL;
pLoc->Release();
return 1; // Program has failed.
}
@@ -171,7 +170,7 @@ S32 LLMachineID::init()
if (FAILED(hres))
{
- LL_WARNS("AppInit") << "Could not set proxy blanket. Error code = 0x" << hex << hres << LL_ENDL;
+ LL_WARNS("AppInit") << "Could not set proxy blanket. Error code = 0x" << std::hex << hres << LL_ENDL;
pSvc->Release();
pLoc->Release();
return 1; // Program has failed.
@@ -191,7 +190,7 @@ S32 LLMachineID::init()
if (FAILED(hres))
{
- LL_WARNS("AppInit") << "Query for operating system name failed." << " Error code = 0x" << hex << hres << LL_ENDL;
+ LL_WARNS("AppInit") << "Query for operating system name failed." << " Error code = 0x" << std::hex << hres << LL_ENDL;
pSvc->Release();
pLoc->Release();
return 1; // Program has failed.
@@ -219,7 +218,7 @@ S32 LLMachineID::init()
hr = pclsObj->Get(L"SerialNumber", 0, &vtProp, 0, 0);
if (FAILED(hr))
{
- LL_WARNS() << "Failed to get SerialNumber. Error code = 0x" << hex << hres << LL_ENDL;
+ LL_WARNS() << "Failed to get SerialNumber. Error code = 0x" << std::hex << hres << LL_ENDL;
pclsObj->Release();
pclsObj = NULL;
continue;