]>
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 | ||
ac776ec9 VS |
77 | /* Mingw runtime 1.0-20010604 has some missing _tXXXX functions, |
78 | so let's define them ourselves: */ | |
e13f1288 MB |
79 | #if defined(__GNUWIN32__) && wxCHECK_W32API_VERSION( 1, 0 ) \ |
80 | && !wxCHECK_W32API_VERSION( 1, 1 ) | |
cd99221a VS |
81 | #ifndef _tsetlocale |
82 | #if wxUSE_UNICODE | |
83 | #define _tsetlocale _wsetlocale | |
84 | #else | |
85 | #define _tsetlocale setlocale | |
86 | #endif | |
87 | #endif | |
88 | #ifndef _tgetenv | |
89 | #if wxUSE_UNICODE | |
90 | #define _tgetenv _wgetenv | |
91 | #else | |
92 | #define _tgetenv getenv | |
93 | #endif | |
94 | #endif | |
95 | #ifndef _tfopen | |
96 | #if wxUSE_UNICODE | |
97 | #define _tfopen _wfopen | |
98 | #else | |
99 | #define _tfopen fopen | |
100 | #endif | |
101 | #endif | |
102 | #endif | |
103 | ||
99d80019 JS |
104 | /* current (= before mingw-runtime 3.3) mingw32 headers forget to |
105 | define _puttchar, this will probably be fixed in the next versions but | |
106 | for now do it ourselves | |
107 | */ | |
01ac0f13 VS |
108 | #if defined( __MINGW32__ ) && \ |
109 | !wxCHECK_MINGW32_VERSION(3,3) && !defined( _puttchar ) | |
08848c9f VZ |
110 | #ifdef wxUSE_UNICODE |
111 | #define _puttchar putwchar | |
112 | #else | |
113 | #define _puttchar puttchar | |
114 | #endif | |
115 | #endif | |
116 | ||
068cfb66 | 117 | #endif |
ac776ec9 | 118 | /* _WX_MSW_GCCPRIV_H_ */ |