1
// ================================================================ //
3
// File : arb_main.h //
4
// Purpose : code executed at start of main() //
6
// Coded by Ralf Westram (coder@reallysoft.de) in February 2014 //
7
// http://www.arb-home.de/ //
9
// ================================================================ //
16
static void start_of_main() {
17
// const char *USER_LOCALE = ""; // -> use user-defined locale
18
const char *USER_LOCALE = "de_DE.UTF-8"; // use german locale
21
// gtk apparently calls 'setlocale(LC_ALL, "");'
22
// @@@ we should already call it here, to make ARB-motif-version behave samesame.
24
// --------------------------------------------------------------------------------
25
// Fails-counts mentioned below were determined under ubuntu 13.10/64bit.
26
// Make sure only one section is enabled!
29
// enabling this section does not fail any unit test
30
setlocale(LC_ALL, "C");
31
// overwritten as soon as gtk-GUI starts (causing wrong behavior throughout ARB)
35
// enabling this section does not fail any unit test
36
setlocale(LC_ALL, USER_LOCALE);
37
setlocale(LC_NUMERIC, "C");
41
// enabling this section does not fail any unit test
42
setlocale(LC_ALL, "C");
43
setlocale(LC_COLLATE, USER_LOCALE);
44
setlocale(LC_CTYPE, USER_LOCALE);
45
setlocale(LC_MESSAGES, USER_LOCALE);
46
setlocale(LC_MONETARY, USER_LOCALE);
47
setlocale(LC_TIME, USER_LOCALE);
52
// enabling this section fails 57 unit tests (for german USER_LOCALE)
53
setlocale(LC_ALL, USER_LOCALE);
57
// enabling this section fails 57 unit tests (for german USER_LOCALE)
58
setlocale(LC_COLLATE, "C");
59
setlocale(LC_CTYPE, "C");
60
setlocale(LC_MESSAGES, "C");
61
setlocale(LC_MONETARY, "C");
62
setlocale(LC_NUMERIC, USER_LOCALE);
63
setlocale(LC_TIME, "C");
67
// enabling this section fails 57 unit tests (for german USER_LOCALE)
68
// (fails 57 unit tests under ubuntu 13.10, centos 5 and 6)
69
setlocale(LC_ALL, "C");
70
setlocale(LC_NUMERIC, USER_LOCALE);
75
#error arb_main.h included twice