Commit | Line | Data |
---|---|---|
99d80019 JS |
1 | /* |
2 | Name: wx/msw/gccpriv.h | |
3 | Purpose: MinGW/Cygwin definitions | |
4 | Author: Vadim Zeitlin | |
5 | Modified by: | |
6 | Created: | |
7 | RCS-ID: $Id$ | |
8 | Copyright: (c) Vadim Zeitlin | |
9 | Licence: wxWindows Licence | |
10 | */ | |
11 | ||
ac776ec9 | 12 | /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ |
068cfb66 VZ |
13 | |
14 | #ifndef _WX_MSW_GCCPRIV_H_ | |
15 | #define _WX_MSW_GCCPRIV_H_ | |
16 | ||
c5c570b9 VS |
17 | #if defined(__MINGW32__) && !defined(__GNUWIN32__) |
18 | #define __GNUWIN32__ | |
19 | #endif | |
20 | ||
8490b71b | 21 | #if defined(__MINGW32__) && ( ( __GNUC__ > 2 ) || ( ( __GNUC__ == 2 ) && ( __GNUC_MINOR__ >= 95 ) ) ) |
d69f2e34 WS |
22 | #include <_mingw.h> |
23 | #endif | |
24 | ||
5283098e | 25 | #if defined( __MINGW32__ ) && !defined(__WINE__) && !defined( HAVE_W32API_H ) |
d69f2e34 WS |
26 | #if __MINGW32_MAJOR_VERSION >= 1 |
27 | #define HAVE_W32API_H | |
5438a566 | 28 | #endif |
0cd0d9a5 | 29 | #elif defined( __CYGWIN__ ) && !defined( HAVE_W32API_H ) |
213ceb3f | 30 | #if ( __GNUC__ > 2 ) |
0cd0d9a5 MB |
31 | #define HAVE_W32API_H |
32 | #endif | |
5438a566 VZ |
33 | #endif |
34 | ||
6d3d756a | 35 | #if wxCHECK_WATCOM_VERSION(1,0) |
ac776ec9 VS |
36 | #define HAVE_W32API_H |
37 | #endif | |
38 | ||
39 | /* check for MinGW/Cygwin w32api version ( releases >= 0.5, only ) */ | |
068cfb66 VZ |
40 | #if defined( HAVE_W32API_H ) |
41 | #include <w32api.h> | |
42 | #endif | |
43 | ||
e4335043 VS |
44 | /* Watcom can't handle defined(xxx) here: */ |
45 | #if defined(__W32API_MAJOR_VERSION) && defined(__W32API_MINOR_VERSION) | |
46 | #define wxCHECK_W32API_VERSION( major, minor ) \ | |
47 | ( ( ( __W32API_MAJOR_VERSION > (major) ) \ | |
068cfb66 | 48 | || ( __W32API_MAJOR_VERSION == (major) && __W32API_MINOR_VERSION >= (minor) ) ) ) |
e4335043 VS |
49 | #else |
50 | #define wxCHECK_W32API_VERSION( major, minor ) (0) | |
51 | #endif | |
068cfb66 | 52 | |
ac776ec9 VS |
53 | /* Cygwin / Mingw32 with gcc >= 2.95 use new windows headers which |
54 | are more ms-like (header author is Anders Norlander, hence the name) */ | |
5283098e | 55 | #if (defined(__MINGW32__) || defined(__CYGWIN__) || defined(__WINE__)) && ((__GNUC__>2) || ((__GNUC__==2) && (__GNUC_MINOR__>=95))) |
068cfb66 VZ |
56 | #ifndef wxUSE_NORLANDER_HEADERS |
57 | #define wxUSE_NORLANDER_HEADERS 1 | |
58 | #endif | |
59 | #else | |
60 | #ifndef wxUSE_NORLANDER_HEADERS | |
61 | #define wxUSE_NORLANDER_HEADERS 0 | |
62 | #endif | |
63 | #endif | |
64 | ||
ac776ec9 VS |
65 | /* "old" GNUWIN32 is the one without Norlander's headers: it lacks the |
66 | standard Win32 headers and we define the used stuff ourselves for it | |
67 | in wx/msw/gnuwin32/extra.h */ | |
068cfb66 VZ |
68 | #if defined(__GNUC__) && !wxUSE_NORLANDER_HEADERS |
69 | #define __GNUWIN32_OLD__ | |
70 | #endif | |
71 | ||
ac776ec9 | 72 | /* Cygwin 1.0 */ |
ae090fdb JS |
73 | #if defined(__CYGWIN__) && ((__GNUC__==2) && (__GNUC_MINOR__==9)) |
74 | #define __CYGWIN10__ | |
75 | #endif | |
76 | ||
01ac0f13 VS |
77 | /* Check for Mingw runtime version: */ |
78 | #if defined(__MINGW32_MAJOR_VERSION) && defined(__MINGW32_MINOR_VERSION) | |
79 | #define wxCHECK_MINGW32_VERSION( major, minor ) \ | |
80 | ( ( ( __MINGW32_MAJOR_VERSION > (major) ) \ | |
81 | || ( __MINGW32_MAJOR_VERSION == (major) && __MINGW32_MINOR_VERSION >= (minor) ) ) ) | |
82 | #else | |
83 | #define wxCHECK_MINGW32_VERSION( major, minor ) (0) | |
84 | #endif | |
85 | ||
ac776ec9 VS |
86 | /* Mingw runtime 1.0-20010604 has some missing _tXXXX functions, |
87 | so let's define them ourselves: */ | |
e13f1288 MB |
88 | #if defined(__GNUWIN32__) && wxCHECK_W32API_VERSION( 1, 0 ) \ |
89 | && !wxCHECK_W32API_VERSION( 1, 1 ) | |
cd99221a VS |
90 | #ifndef _tsetlocale |
91 | #if wxUSE_UNICODE | |
92 | #define _tsetlocale _wsetlocale | |
93 | #else | |
94 | #define _tsetlocale setlocale | |
95 | #endif | |
96 | #endif | |
97 | #ifndef _tgetenv | |
98 | #if wxUSE_UNICODE | |
99 | #define _tgetenv _wgetenv | |
100 | #else | |
101 | #define _tgetenv getenv | |
102 | #endif | |
103 | #endif | |
104 | #ifndef _tfopen | |
105 | #if wxUSE_UNICODE | |
106 | #define _tfopen _wfopen | |
107 | #else | |
108 | #define _tfopen fopen | |
109 | #endif | |
110 | #endif | |
111 | #endif | |
112 | ||
99d80019 JS |
113 | /* current (= before mingw-runtime 3.3) mingw32 headers forget to |
114 | define _puttchar, this will probably be fixed in the next versions but | |
115 | for now do it ourselves | |
116 | */ | |
01ac0f13 VS |
117 | #if defined( __MINGW32__ ) && \ |
118 | !wxCHECK_MINGW32_VERSION(3,3) && !defined( _puttchar ) | |
08848c9f VZ |
119 | #ifdef wxUSE_UNICODE |
120 | #define _puttchar putwchar | |
121 | #else | |
122 | #define _puttchar puttchar | |
123 | #endif | |
124 | #endif | |
125 | ||
068cfb66 | 126 | #endif |
ac776ec9 | 127 | /* _WX_MSW_GCCPRIV_H_ */ |