summaryrefslogtreecommitdiff
path: root/src/gettext.cpp
diff options
context:
space:
mode:
authorBlockMen <nmuelll@web.de>2015-02-12 02:55:50 +0100
committerBlockMen <nmuelll@web.de>2015-02-12 16:03:55 +0100
commitd3026293927f560465b325280fef697cc3361daa (patch)
tree6dfe86bb89450f7a47be1e787e51541a20a33846 /src/gettext.cpp
parente102cbd840c3dc3d52865868369aea3b8ee21028 (diff)
downloadminetest-d3026293927f560465b325280fef697cc3361daa.tar.gz
minetest-d3026293927f560465b325280fef697cc3361daa.tar.bz2
minetest-d3026293927f560465b325280fef697cc3361daa.zip
Fix gettext on MSVC
Diffstat (limited to 'src/gettext.cpp')
-rw-r--r--src/gettext.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/gettext.cpp b/src/gettext.cpp
index 688a22570..fc7569418 100644
--- a/src/gettext.cpp
+++ b/src/gettext.cpp
@@ -26,24 +26,24 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "log.h"
#if USE_GETTEXT && defined(_MSC_VER)
-#include <WinNls.h>
+#include <windows.h>
#include <map>
#include <direct.h>
#include "filesys.h"
-#define setlocale(category,localename) \
- setlocale(category,MSVC_LocaleLookup(localename))
+#define setlocale(category, localename) \
+ setlocale(category, MSVC_LocaleLookup(localename))
-static std::map<std::wstring,std::wstring> glb_supported_locales;
+static std::map<std::wstring, std::wstring> glb_supported_locales;
/******************************************************************************/
BOOL CALLBACK UpdateLocaleCallback(LPTSTR pStr)
{
char* endptr = 0;
- int LOCALEID = strtol(pStr,&endptr,16);
+ int LOCALEID = strtol(pStr, &endptr,16);
wchar_t buffer[LOCALE_NAME_MAX_LENGTH];
- memset(buffer,0,sizeof(buffer));
+ memset(buffer, 0, sizeof(buffer));
if (GetLocaleInfoW(
LOCALEID,
LOCALE_SISO639LANGNAME,
@@ -52,7 +52,7 @@ BOOL CALLBACK UpdateLocaleCallback(LPTSTR pStr)
std::wstring name = buffer;
- memset(buffer,0,sizeof(buffer));
+ memset(buffer, 0, sizeof(buffer));
GetLocaleInfoW(
LOCALEID,
LOCALE_SISO3166CTRYNAME,
@@ -61,7 +61,7 @@ BOOL CALLBACK UpdateLocaleCallback(LPTSTR pStr)
std::wstring country = buffer;
- memset(buffer,0,sizeof(buffer));
+ memset(buffer, 0, sizeof(buffer));
GetLocaleInfoW(
LOCALEID,
LOCALE_SENGLISHLANGUAGENAME,
@@ -96,7 +96,7 @@ const char* MSVC_LocaleLookup(const char* raw_shortname) {
}
if (first_use) {
- EnumSystemLocalesA(UpdateLocaleCallback,LCID_SUPPORTED | LCID_ALTERNATE_SORTS);
+ EnumSystemLocalesA(UpdateLocaleCallback, LCID_SUPPORTED | LCID_ALTERNATE_SORTS);
first_use = false;
}
@@ -148,8 +148,8 @@ void init_gettext(const char *path, const std::string &configured_language) {
if (current_language_var != configured_language) {
STARTUPINFO startupinfo;
PROCESS_INFORMATION processinfo;
- memset(&startupinfo,0,sizeof(startupinfo));
- memset(&processinfo,0,sizeof(processinfo));
+ memset(&startupinfo, 0, sizeof(startupinfo));
+ memset(&processinfo, 0, sizeof(processinfo));
errorstream << "MSVC localization workaround active restating minetest in new environment!" << std::endl;
std::string parameters = "";
@@ -169,7 +169,7 @@ void init_gettext(const char *path, const std::string &configured_language) {
/** users may start by short name in commandline without extention **/
std::string appname = argv[0];
- if (appname.substr(appname.length() -4) != ".exe") {
+ if (appname.substr(appname.length() - 4) != ".exe") {
appname += ".exe";
}
@@ -260,7 +260,7 @@ void init_gettext(const char *path, const std::string &configured_language) {
/* no matter what locale is used we need number format to be "C" */
/* to ensure formspec parameters are evaluated correct! */
- setlocale(LC_NUMERIC,"C");
+ setlocale(LC_NUMERIC, "C");
infostream << "Message locale is now set to: "
<< setlocale(LC_ALL, 0) << std::endl;
}