diff options
author | kkinnunen <kkinnunen@nvidia.com> | 2014-11-13 05:13:50 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-13 05:13:50 -0800 |
commit | 6438f9aca75ae5a92044458fdc20040544e02709 (patch) | |
tree | 67e2a24953d5819f2e27f325cb30d8bed79983f7 /debugger | |
parent | c092d3bdab5f723576cc0346cea3ee282a9cb444 (diff) |
Fix debugger with GL to work with non-default locale
QApplication forces the process to use the C locale system on
"Unix/Linux" according to the docs.
The float numbers in GL shaders will be printed with printf. These will
be formatted with comma in certain locales, like LC_NUMERIC=fi_FI.UTF-8.
Force the NC_NUMERIC=C before running the QApplication.
Review URL: https://codereview.chromium.org/724753002
Diffstat (limited to 'debugger')
-rw-r--r-- | debugger/debuggermain.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/debugger/debuggermain.cpp b/debugger/debuggermain.cpp index f749911a98..d537d363c9 100644 --- a/debugger/debuggermain.cpp +++ b/debugger/debuggermain.cpp @@ -17,8 +17,13 @@ static void usage(const char * argv0) { } int main(int argc, char *argv[]) { +#ifndef SK_BUILD_FOR_WIN32 + // Set numeric formatting to default. Otherwise shaders will have numbers with wrong comma. + // QApplication documentation recommends setlocale("LC_NUMERIC", "C") after QApplication + // constuction. However, the components Qt calls (X11 libs, ..) will override that. + setenv("LC_NUMERIC", "C", 1); +#endif QApplication a(argc, argv); - QStringList argList = a.arguments(); if (argList.count() <= 0) { |