File: wave_locale.h

package info (click to toggle)
gtkwave 3.1.10-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 10,060 kB
  • ctags: 12,772
  • sloc: ansic: 136,257; cpp: 3,443; sh: 959; makefile: 756; lex: 210
file content (41 lines) | stat: -rw-r--r-- 809 bytes parent folder | download
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

#ifndef __WAVE_LOCALE_H__
#define __WAVE_LOCALE_H__

#include "config.h"

#if HAVE_SETENV && HAVE_UNSETENV
#define WAVE_LOCALE_FIX \
{ \
char *e = getenv("LANG"); \
if(e) \
        { \
        if(strcmp(e, "C")) \
                { \
                setenv("LC_NUMERIC", "C", 1); \
                setenv("LC_COLLATE", "C", 1); \
                setenv("LC_CTYPE", "C", 1); \
                } \
        } \
e = getenv("LC_ALL"); \
if(e) \
        { \
        if(strcmp(e, "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 /* __WAVE_LOCALE_H__*/