]>
Commit | Line | Data |
---|---|---|
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 | ||
12 | /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ | |
13 | ||
14 | #ifndef _WX_MSW_GCCPRIV_H_ | |
15 | #define _WX_MSW_GCCPRIV_H_ | |
16 | ||
17 | #if defined(__MINGW32__) && !defined(__GNUWIN32__) | |
18 | #define __GNUWIN32__ | |
19 | #endif | |
20 | ||
21 | #if defined(__MINGW32__) && ( ( __GNUC__ > 2 ) || ( ( __GNUC__ == 2 ) && ( __GNUC_MINOR__ >= 95 ) ) ) | |
22 | #include <_mingw.h> | |
23 | #endif | |
24 | ||
25 | #if defined( __MINGW32__ ) && !defined(__WINE__) && !defined( HAVE_W32API_H ) | |
26 | #if __MINGW32_MAJOR_VERSION >= 1 | |
27 | #define HAVE_W32API_H | |
28 | #endif | |
29 | #elif defined( __CYGWIN__ ) && !defined( HAVE_W32API_H ) | |
30 | #if ( __GNUC__ > 2 ) | |
31 | #define HAVE_W32API_H | |
32 | #endif | |
33 | #endif | |
34 | ||
35 | #if wxCHECK_WATCOM_VERSION(1,0) | |
36 | #define HAVE_W32API_H | |
37 | #endif | |
38 | ||
39 | /* check for MinGW/Cygwin w32api version ( releases >= 0.5, only ) */ | |
40 | #if defined( HAVE_W32API_H ) | |
41 | #include <w32api.h> | |
42 | #endif | |
43 | ||
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) ) \ | |
48 | || ( __W32API_MAJOR_VERSION == (major) && __W32API_MINOR_VERSION >= (minor) ) ) ) | |
49 | #else | |
50 | #define wxCHECK_W32API_VERSION( major, minor ) (0) | |
51 | #endif | |
52 | ||
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) */ | |
55 | #if (defined(__MINGW32__) || defined(__CYGWIN__) || defined(__WINE__)) && ((__GNUC__>2) || ((__GNUC__==2) && (__GNUC_MINOR__>=95))) | |
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 | ||
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 */ | |
68 | #if defined(__GNUC__) && !wxUSE_NORLANDER_HEADERS | |
69 | #define __GNUWIN32_OLD__ | |
70 | #endif | |
71 | ||
72 | /* Cygwin 1.0 */ | |
73 | #if defined(__CYGWIN__) && ((__GNUC__==2) && (__GNUC_MINOR__==9)) | |
74 | #define __CYGWIN10__ | |
75 | #endif | |
76 | ||
77 | /* Mingw runtime 1.0-20010604 has some missing _tXXXX functions, | |
78 | so let's define them ourselves: */ | |
79 | #if defined(__GNUWIN32__) && wxCHECK_W32API_VERSION( 1, 0 ) \ | |
80 | && !wxCHECK_W32API_VERSION( 1, 1 ) | |
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 | ||
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 | */ | |
108 | #if defined( __MINGW32__ ) && \ | |
109 | !wxCHECK_MINGW32_VERSION(3,3) && !defined( _puttchar ) | |
110 | #ifdef wxUSE_UNICODE | |
111 | #define _puttchar putwchar | |
112 | #else | |
113 | #define _puttchar puttchar | |
114 | #endif | |
115 | #endif | |
116 | ||
117 | #endif | |
118 | /* _WX_MSW_GCCPRIV_H_ */ |