File: wave_locale.h

package info (click to toggle)
gtkwave 3.3.98-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 10,200 kB
  • sloc: ansic: 136,610; sh: 4,558; cpp: 2,156; java: 634; makefile: 310; lex: 236; xml: 194; perl: 93; objc: 68; csh: 28; tcl: 25
file content (45 lines) | stat: -rw-r--r-- 929 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef __WAVE_LOCALE_H__
#define __WAVE_LOCALE_H__

#include "config.h"

#ifdef __MINGW32__
#include "locale.h"
#define WAVE_LOCALE_FIX {setlocale(LC_ALL, "C"); }
#else
#if HAVE_SETENV && HAVE_UNSETENV
#define WAVE_LOCALE_FIX \
{ \
char *wlve = getenv("LANG"); \
if(wlve) \
        { \
        if(strcmp(wlve, "C")) \
                { \
                setenv("LC_NUMERIC", "C", 1); \
                setenv("LC_COLLATE", "C", 1); \
                setenv("LC_CTYPE", "C", 1); \
                } \
        } \
wlve = getenv("LC_ALL"); \
if(wlve) \
        { \
        if(strcmp(wlve, "C")) \
                { \
                unsetenv("LC_ALL"); \
                } \
        } \
}
#else
#define WAVE_LOCALE_FIX \
{ \
putenv(strdup("LANG=C")); \
putenv(strdup("LC_NUMERIC=C")); \
putenv(strdup("LC_COLLATE=C")); \
putenv(strdup("LC_CTYPE=C")); \
putenv(strdup("LC_ALL=C")); \
}
#endif
#endif

#endif /* __WAVE_LOCALE_H__*/