Skip to content

Commit

Permalink
language() fixes on Windows, concludes 0.7.37
Browse files Browse the repository at this point in the history
  • Loading branch information
jlnr committed Sep 11, 2011
1 parent 302b257 commit 2538506
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
4 changes: 0 additions & 4 deletions Gosu/Utility.hpp
Expand Up @@ -6,7 +6,6 @@

#include <string>
#include <vector>
#include <Gosu/Platform.hpp>

namespace Gosu
{
Expand All @@ -20,12 +19,9 @@ namespace Gosu
//! Converts an std::wstring into an std::string using local encoding.
std::string narrow(const std::wstring& ws);

// TODO: Remove #ifdef when Windows is done
#ifndef GOSU_IS_WIN
//! Returns the user's preferred language, at the moment of calling the function. Expect return
//! values such as 'en_US', 'de_DE.UTF-8', 'ja', 'zh-Hans'.
std::string language();
#endif
}

#endif
4 changes: 2 additions & 2 deletions GosuImpl/UtilityWin.cpp
Expand Up @@ -6,8 +6,8 @@ using namespace std;
string Gosu::language()
{
LCID lcid = GetUserDefaultLCID();
char[9] buffer;
char buffer[9];
Win::check(
GetLocaleInfoA(lcid, LOCALE_SISO639LANGNAME, &buffer, sizeof buffer));
GetLocaleInfoA(lcid, LOCALE_SISO639LANGNAME, buffer, sizeof buffer));
return buffer;
}
20 changes: 16 additions & 4 deletions windows/Gosu.vcproj
Expand Up @@ -41,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)/../&quot;;&quot;$(SolutionDir)/../dependencies/libogg/include/&quot;;&quot;$(SolutionDir)/../dependencies/libvorbis/include/&quot;;$(NOINHERIT)"
AdditionalIncludeDirectories="&quot;$(SolutionDir)/../&quot;;&quot;$(SolutionDir)/../dependencies/libsndfile/&quot;;&quot;$(SolutionDir)/../dependencies/libogg/include/&quot;;&quot;$(SolutionDir)/../dependencies/libvorbis/include/&quot;;$(NOINHERIT)"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="false"
BasicRuntimeChecks="3"
Expand Down Expand Up @@ -109,7 +109,7 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
WholeProgramOptimization="false"
AdditionalIncludeDirectories="&quot;$(SolutionDir)/../&quot;;&quot;$(SolutionDir)/../dependencies/libogg/include/&quot;;&quot;$(SolutionDir)/../dependencies/libvorbis/include/&quot;;$(NOINHERIT)"
AdditionalIncludeDirectories="&quot;$(SolutionDir)/../&quot;;&quot;$(SolutionDir)/../dependencies/libsndfile/&quot;;&quot;$(SolutionDir)/../dependencies/libogg/include/&quot;;&quot;$(SolutionDir)/../dependencies/libvorbis/include/&quot;;$(NOINHERIT)"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
Expand Down Expand Up @@ -208,6 +208,10 @@
RelativePath="..\GosuImpl\Utility.cpp"
>
</File>
<File
RelativePath="..\GosuImpl\UtilityWin.cpp"
>
</File>
<File
RelativePath="..\GosuImpl\WindowWin.cpp"
>
Expand Down Expand Up @@ -425,11 +429,11 @@
>
</File>
<File
RelativePath="..\Gosu\Sockets.hpp"
RelativePath="..\GosuImpl\Sockets\Sockets.hpp"
>
</File>
<File
RelativePath="..\GosuImpl\Sockets\Sockets.hpp"
RelativePath="..\Gosu\Sockets.hpp"
>
</File>
<File
Expand Down Expand Up @@ -572,6 +576,14 @@
>
</File>
</Filter>
<Filter
Name="libsndfile"
>
<File
RelativePath="..\dependencies\libsndfile\sndfile.h"
>
</File>
</Filter>
</Filter>
</Files>
<Globals>
Expand Down

0 comments on commit 2538506

Please sign in to comment.