summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorAnsariel <ansariel.hiller@phoenixviewer.com>2024-06-10 23:43:50 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-06-11 01:56:08 +0300
commit9f6b8484dfb7dfa981d8a8ac3693d3f68e32bc12 (patch)
treebff0d3ad6bb7643be0510cd604aacef7c76ae4bb /indra/llcommon
parent901c3cbe09dae85ccc0c1ce0661a7b878293b608 (diff)
Re-enable compiler warnings C4127, C4512 & C4706
Disable particular CRT and WinSock API warnings for functions Microsoft considers unsafe/deprecated
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llfile.cpp12
-rw-r--r--indra/llcommon/llfindlocale.cpp8
-rw-r--r--indra/llcommon/llpreprocessor.h14
3 files changed, 21 insertions, 13 deletions
diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp
index 6fdf58a99b..ddf239f306 100644
--- a/indra/llcommon/llfile.cpp
+++ b/indra/llcommon/llfile.cpp
@@ -27,6 +27,12 @@
* $/LicenseInfo$
*/
+#include "linden_common.h"
+#include "llfile.h"
+#include "llstring.h"
+#include "llerror.h"
+#include "stringize.h"
+
#if LL_WINDOWS
#include "llwin32headerslean.h"
#include <stdlib.h> // Windows errno
@@ -35,12 +41,6 @@
#include <errno.h>
#endif
-#include "linden_common.h"
-#include "llfile.h"
-#include "llstring.h"
-#include "llerror.h"
-#include "stringize.h"
-
using namespace std;
static std::string empty;
diff --git a/indra/llcommon/llfindlocale.cpp b/indra/llcommon/llfindlocale.cpp
index e39812bfc4..ac52f90c9f 100644
--- a/indra/llcommon/llfindlocale.cpp
+++ b/indra/llcommon/llfindlocale.cpp
@@ -157,14 +157,22 @@ canonise_fl(FL_Locale *l) {
if (l->lang && 0 == strcmp(l->lang, "en")) {
if (l->country && 0 == strcmp(l->country, "UK")) {
free((void*)l->country);
+#ifdef LL_WINDOWS
+ l->country = _strdup("GB");
+#else
l->country = strdup("GB");
+#endif
}
}
/* ja_JA -> ja_JP */
if (l->lang && 0 == strcmp(l->lang, "ja")) {
if (l->country && 0 == strcmp(l->country, "JA")) {
free((void*)l->country);
+#ifdef LL_WINDOWS
+ l->country = _strdup("JP");
+#else
l->country = strdup("JP");
+#endif
}
}
}
diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h
index 65ecd573e4..0248e8f8b9 100644
--- a/indra/llcommon/llpreprocessor.h
+++ b/indra/llcommon/llpreprocessor.h
@@ -120,20 +120,20 @@
#endif // LL_WINDOWS
-// Deal with VC6 problems
+// Deal with VC++ problems
#if LL_MSVC
-#pragma warning( disable : 4996 ) // warning: deprecated
+#ifndef _CRT_SECURE_NO_WARNINGS
+#define _CRT_SECURE_NO_WARNINGS // disable warnings for methods considered unsafe
+#endif
+#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS
+#define _WINSOCK_DEPRECATED_NO_WARNINGS // disable deprecated WinSock API warnings
+#endif
// level 4 warnings that we need to disable:
-#pragma warning (disable : 4127) // conditional expression is constant (e.g. while(1) )
#pragma warning (disable : 4244) // possible loss of data on conversions
#pragma warning (disable : 4396) // the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
-#pragma warning (disable : 4512) // assignment operator could not be generated
-#pragma warning (disable : 4706) // assignment within conditional (even if((x = y)) )
-
#pragma warning (disable : 4251) // member needs to have dll-interface to be used by clients of class
#pragma warning (disable : 4275) // non dll-interface class used as base for dll-interface class
-
#endif // LL_MSVC
#if LL_WINDOWS