Diffstat (limited to 'mkspecs/win32-borland/qplatformdefs.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | mkspecs/win32-borland/qplatformdefs.h | 174 |
1 files changed, 94 insertions, 80 deletions
diff --git a/mkspecs/win32-borland/qplatformdefs.h b/mkspecs/win32-borland/qplatformdefs.h index 5babada..121f863 100644 --- a/mkspecs/win32-borland/qplatformdefs.h +++ b/mkspecs/win32-borland/qplatformdefs.h | |||
@@ -1,140 +1,154 @@ | |||
1 | #ifndef QPLATFORMDEFS_H | 1 | #ifndef QPLATFORMDEFS_H |
2 | #define QPLATFORMDEFS_H | 2 | #define QPLATFORMDEFS_H |
3 | 3 | ||
4 | #ifdef UNICODE | 4 | #ifdef UNICODE |
5 | #ifndef _UNICODE | 5 | #ifndef _UNICODE |
6 | #define _UNICODE | 6 | #define _UNICODE |
7 | #endif | 7 | #endif |
8 | #endif | 8 | #endif |
9 | 9 | ||
10 | // Get Qt defines/settings | 10 | // Get Qt defines/settings |
11 | 11 | ||
12 | #include "qglobal.h" | 12 | #include "qglobal.h" |
13 | #define Q_FS_FAT | 13 | #define Q_FS_FAT |
14 | 14 | ||
15 | #define _POSIX_ | 15 | #define _POSIX_ |
16 | #include <limits.h> | 16 | #include <limits.h> |
17 | #undef _POSIX_ | 17 | #undef _POSIX_ |
18 | 18 | ||
19 | #include <tchar.h> | 19 | #include <tchar.h> |
20 | #include <io.h> | 20 | #include <io.h> |
21 | #include <direct.h> | 21 | #include <direct.h> |
22 | #include <stdio.h> | 22 | #include <stdio.h> |
23 | #include <fcntl.h> | 23 | #include <fcntl.h> |
24 | #include <errno.h> | 24 | #include <errno.h> |
25 | #include <sys/stat.h> | 25 | #include <sys/stat.h> |
26 | #include <dos.h> | 26 | #include <dos.h> |
27 | #include <stdlib.h> | 27 | #include <stdlib.h> |
28 | #include <windows.h> | 28 | #include <windows.h> |
29 | 29 | ||
30 | #if __BORLANDC__ >= 0x550 | 30 | #if __BORLANDC__ >= 0x550 |
31 | #ifdef QT_LARGE_FILE_SUPPORT | 31 | // Borland Builder 6 |
32 | #define QT_STATBUF struct stati64 // non-ANSI defs | 32 | |
33 | #define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs | 33 | #ifdef QT_LARGEFILE_SUPPORT |
34 | #define QT_STAT ::stati64 | 34 | # define QT_STATBUF struct stati64 // non-ANSI defs |
35 | #define QT_FSTAT ::fstati64 | 35 | # define QT_STATBUF4TSTAT struct stati64 // non-ANSI defs |
36 | # define QT_STAT ::_stati64 | ||
37 | # define QT_FSTAT ::fstati64 | ||
38 | # define QT_LSEEK ::_lseeki64 | ||
39 | # define QT_TSTAT ::_tstati64 | ||
36 | #else | 40 | #else |
37 | #define QT_STATBUF struct stat // non-ANSI defs | 41 | # define QT_STATBUF struct stat // non-ANSI defs |
38 | #define QT_STATBUF4TSTAT struct _stat // non-ANSI defs | 42 | # define QT_STATBUF4TSTAT struct _stat // non-ANSI defs |
39 | #define QT_STAT ::stat | 43 | # define QT_STAT ::stat |
40 | #define QT_FSTAT ::fstat | 44 | # define QT_FSTAT ::fstat |
45 | # define QT_LSEEK ::_lseek | ||
46 | # define QT_TSTAT ::_tstat | ||
41 | #endif | 47 | #endif |
42 | # define QT_STAT_REG _S_IFREG | 48 | |
43 | # define QT_STAT_DIR _S_IFDIR | 49 | #define QT_STAT_REG _S_IFREG |
44 | # define QT_STAT_MASK _S_IFMT | 50 | #define QT_STAT_DIR _S_IFDIR |
45 | # if defined(_S_IFLNK) | 51 | #define QT_STAT_MASK _S_IFMT |
52 | |||
53 | #if defined(_S_IFLNK) | ||
46 | # define QT_STAT_LNK _S_IFLNK | 54 | # define QT_STAT_LNK _S_IFLNK |
47 | # endif | ||
48 | # define QT_FILENO _fileno | ||
49 | # define QT_OPEN ::open | ||
50 | # define QT_CLOSE ::_close | ||
51 | #ifdef QT_LARGE_FILE_SUPPORT | ||
52 | #define QT_LSEEK ::_lseeki64 | ||
53 | #define QT_TSTAT ::_tstati64 | ||
54 | #else | ||
55 | #define QT_LSEEK ::_lseek | ||
56 | #define QT_TSTAT ::_tstat | ||
57 | #endif | 55 | #endif |
58 | # define QT_READ ::_read | 56 | |
59 | # define QT_WRITE ::_write | 57 | #define QT_FILENO _fileno |
60 | # define QT_ACCESS ::_access | 58 | #define QT_OPEN ::open |
61 | # define QT_GETCWD ::_getcwd | 59 | #define QT_CLOSE ::_close |
62 | # define QT_CHDIR ::chdir | 60 | |
63 | # define QT_MKDIR ::_mkdir | 61 | #define QT_READ ::_read |
64 | # define QT_RMDIR ::_rmdir | 62 | #define QT_WRITE ::_write |
65 | # define QT_OPEN_RDONLY _O_RDONLY | 63 | #define QT_ACCESS ::_access |
66 | # define QT_OPEN_WRONLY _O_WRONLY | 64 | #define QT_GETCWD ::_getcwd |
67 | # define QT_OPEN_RDWR _O_RDWR | 65 | #define QT_CHDIR ::chdir |
68 | # define QT_OPEN_CREAT _O_CREAT | 66 | #define QT_MKDIR ::_mkdir |
69 | # define QT_OPEN_TRUNC _O_TRUNC | 67 | #define QT_RMDIR ::_rmdir |
70 | # define QT_OPEN_APPEND _O_APPEND | 68 | #define QT_OPEN_RDONLY _O_RDONLY |
71 | # if defined(O_TEXT) | 69 | #define QT_OPEN_WRONLY _O_WRONLY |
70 | #define QT_OPEN_RDWR _O_RDWR | ||
71 | #define QT_OPEN_CREAT _O_CREAT | ||
72 | #define QT_OPEN_TRUNC _O_TRUNC | ||
73 | #define QT_OPEN_APPEND _O_APPEND | ||
74 | |||
75 | #if defined(O_TEXT) | ||
72 | # define QT_OPEN_TEXT _O_TEXT | 76 | # define QT_OPEN_TEXT _O_TEXT |
73 | # define QT_OPEN_BINARY_O_BINARY | 77 | # define QT_OPEN_BINARY_O_BINARY |
74 | # endif | 78 | #endif |
75 | #else // all other systems | 79 | |
76 | #ifdef QT_LARGE_FILE_SUPPORT | ||
77 | #define QT_STATBUF struct stati64 // non-ANSI defs | ||
78 | #define QT_STATBUF4TSTAT struct stati64 // non-ANSI defs | ||
79 | #define QT_STAT ::stati64 | ||
80 | #define QT_FSTAT ::fstati64 | ||
81 | #else | 80 | #else |
82 | #define QT_STATBUF struct stat // non-ANSI defs | 81 | // Borland Builder 5 |
83 | #define QT_STATBUF4TSTAT struct stat // non-ANSI defs | 82 | |
84 | #define QT_STAT ::stat | 83 | #ifdef QT_LARGEFILE_SUPPORT |
85 | #define QT_FSTAT ::fstat | 84 | # define QT_STATBUF struct stati64 // non-ANSI defs |
85 | # define QT_STATBUF4TSTAT struct stati64 // non-ANSI defs | ||
86 | # define QT_STAT ::stati64 | ||
87 | # define QT_FSTAT ::fstati64 | ||
88 | # define QT_LSEEK ::lseeki64 | ||
89 | # define QT_TSTAT ::tstati64 | ||
90 | #else | ||
91 | # define QT_STATBUF struct stat // non-ANSI defs | ||
92 | # define QT_STATBUF4TSTAT struct stat // non-ANSI defs | ||
93 | # define QT_STAT ::stat | ||
94 | # define QT_FSTAT ::fstat | ||
95 | # define QT_LSEEK ::lseek | ||
96 | # define QT_TSTAT ::tstat | ||
86 | #endif | 97 | #endif |
87 | # define QT_STAT_REG S_IFREG | 98 | |
88 | # define QT_STAT_DIR S_IFDIR | 99 | #define QT_STAT_REG S_IFREG |
89 | # define QT_STAT_MASK S_IFMT | 100 | #define QT_STAT_DIR S_IFDIR |
90 | # if defined(S_IFLNK) | 101 | #define QT_STAT_MASK S_IFMT |
102 | |||
103 | #if defined(S_IFLNK) | ||
91 | # define QT_STAT_LNK S_IFLNK | 104 | # define QT_STAT_LNK S_IFLNK |
92 | # endif | ||
93 | # define QT_FILENO fileno | ||
94 | # define QT_OPEN ::open | ||
95 | # define QT_CLOSE ::close | ||
96 | #ifdef QT_LARGE_FILE_SUPPORT | ||
97 | #define QT_LSEEK ::lseeki64 | ||
98 | #define QT_TSTAT ::tstati64 | ||
99 | #else | ||
100 | #define QT_LSEEK ::lseek | ||
101 | #define QT_TSTAT ::tstat | ||
102 | #endif | 105 | #endif |
103 | # define QT_READ ::read | 106 | |
104 | # define QT_WRITE ::write | 107 | #define QT_FILENO fileno |
105 | # define QT_ACCESS ::access | 108 | #define QT_OPEN ::open |
106 | # if defined(Q_OS_OS2EMX) | 109 | #define QT_CLOSE ::close |
107 | // This is documented in the un*x to OS/2-EMX Porting FAQ: | 110 | |
108 | // http://homepages.tu-darmstadt.de/~st002279/os2/porting.html | 111 | #define QT_READ ::read |
112 | #define QT_WRITE ::write | ||
113 | #define QT_ACCESS ::access | ||
114 | |||
115 | #if defined(Q_OS_OS2EMX) | ||
116 | // This is documented in the un*x to OS/2-EMX Porting FAQ: | ||
117 | // http://homepages.tu-darmstadt.de/~st002279/os2/porting.html | ||
109 | # define QT_GETCWD ::_getcwd2 | 118 | # define QT_GETCWD ::_getcwd2 |
110 | # define QT_CHDIR ::_chdir2 | 119 | # define QT_CHDIR ::_chdir2 |
111 | # else | 120 | #else |
112 | # define QT_GETCWD ::getcwd | 121 | # define QT_GETCWD ::getcwd |
113 | # define QT_CHDIR ::chdir | 122 | # define QT_CHDIR ::chdir |
114 | # endif | 123 | #endif |
115 | # define QT_MKDIR ::mkdir | 124 | |
116 | # define QT_RMDIR ::rmdir | 125 | #define QT_MKDIR ::mkdir |
117 | # define QT_OPEN_RDONLY O_RDONLY | 126 | #define QT_RMDIR ::rmdir |
118 | # define QT_OPEN_WRONLY O_WRONLY | 127 | #define QT_OPEN_RDONLY O_RDONLY |
119 | # define QT_OPEN_RDWR O_RDWR | 128 | #define QT_OPEN_WRONLY O_WRONLY |
120 | # define QT_OPEN_CREAT O_CREAT | 129 | #define QT_OPEN_RDWR O_RDWR |
121 | # define QT_OPEN_TRUNC O_TRUNC | 130 | #define QT_OPEN_CREAT O_CREAT |
122 | # define QT_OPEN_APPEND O_APPEND | 131 | #define QT_OPEN_TRUNC O_TRUNC |
123 | # if defined(O_TEXT) | 132 | #define QT_OPEN_APPEND O_APPEND |
133 | |||
134 | #if defined(O_TEXT) | ||
124 | # define QT_OPEN_TEXT O_TEXT | 135 | # define QT_OPEN_TEXT O_TEXT |
125 | # define QT_OPEN_BINARYO_BINARY | 136 | # define QT_OPEN_BINARYO_BINARY |
126 | # endif | ||
127 | #endif | 137 | #endif |
128 | 138 | ||
139 | #endif // __BORLANDC__ >= 0x550 | ||
140 | |||
141 | // Borland Builder 5 and 6 | ||
142 | |||
129 | #define QT_SIGNAL_ARGS int | 143 | #define QT_SIGNAL_ARGS int |
130 | 144 | ||
131 | #define QT_VSNPRINTF ::_vsnprintf | 145 | #define QT_VSNPRINTF ::_vsnprintf |
132 | #define QT_SNPRINTF ::_snprintf | 146 | #define QT_SNPRINTF ::_snprintf |
133 | 147 | ||
134 | # define F_OK0 | 148 | # define F_OK0 |
135 | # define X_OK1 | 149 | # define X_OK1 |
136 | # define W_OK2 | 150 | # define W_OK2 |
137 | # define R_OK4 | 151 | # define R_OK4 |
138 | 152 | ||
139 | 153 | ||
140 | #endif // QPLATFORMDEFS_H | 154 | #endif // QPLATFORMDEFS_H |