Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d049c28731fe2feb88bd01791602f376a0ef3fe1 (plain) (blame)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*******************************************************************************
 * Copyright (c) 2000, 2007 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at 
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     Silenio Quarti
 *******************************************************************************/

#ifndef ECLIPSE_UNICODE_H
#define ECLIPSE_UNICODE_H

#ifdef _WIN32

#ifdef UNICODE
#define _UNICODE
#endif
#include <windows.h>
#include <tchar.h>
#include <ctype.h>

#ifdef __MINGW32__
# ifdef UNICODE
#  ifndef _TCHAR
#   define _TCHAR TCHAR
#  endif /* _TCHAR */
#  ifndef _tgetcwd
#   define _tgetcwd _wgetcwd
#  endif /* _tgetcwd */
#  ifndef _tstat
#   define _tstat _wstat
#  endif /* _tstat */
#  ifndef _topendir
#   define _topendir _wopendir
#  endif /* _topendir */
#  ifndef _treaddir
#   define _treaddir _wreaddir
#  endif /* _treaddir */
#  ifndef _tclosedir
#   define _tclosedir _wclosedir
#  endif /* _tclosedir */
#  ifndef _tDIR
#   define _tDIR _WDIR
#  endif /* _tDIR */
# else /* UNICODE */
#  ifndef _TCHAR
#   define _TCHAR char
#  endif /* _TCHAR */
#  ifndef _tgetcwd
#   define _tgetcwd getcwd
#  endif /* _tgetcwd */
#  ifndef _tstat
#   define _tstat _stat
#  endif /* _tstat */
#  ifndef _topendir
#error message!
#   define _topendir opendir
#  endif /* _topendir */
#  ifndef _treaddir
#   define _treaddir readdir
#  endif /* _treaddir */
#  ifndef _tclosedir
#   define _tclosedir closedir
#  endif /* _tclosedir */
#  ifndef _tDIR
#   define _tDIR DIR
#  endif /* _tDIR */
# endif /* UNICODE */
#endif /* __MINGW32__ */

#define _T_ECLIPSE _T

#else /* Platforms other than Windows */

#define _TCHAR char
#define _T_ECLIPSE(s) s
#define _fgetts fgets
#define _stat stat
#define _stprintf sprintf
#define _ftprintf fprintf
#define _stscanf sscanf
#define _tcscat strcat
#define _tcschr strchr
#define _tcspbrk strpbrk
#define _tcscmp strcmp
#define _tcscpy strcpy
#define _tcsdup strdup
#define _tcsicmp strcasecmp
#define _tcslen strlen
#define _tcsncpy strncpy
#define _tcsrchr strrchr
#define _tfopen fopen
#define _tgetcwd getcwd
#define _tgetenv getenv
#define _tcstol strtol
#define _tcstok strtok
#ifndef LINUX
#define _totupper toupper
#endif /* LINUX */
#define _tprintf printf
#define _tstat stat
#define _tcsncmp strncmp
#define _tcsstr strstr 
#define _topendir opendir
#define _treaddir readdir
#define _tclosedir closedir
#define _tDIR DIR
#endif /* _WIN32 */

#endif /* ECLIPSE_UNICODE_H */

Back to the top