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