30e59452eb5e6c08cfb510c8f8f189ea133e729d
[fedora-mingw.git] / qt-win / qplatformdefs.h
1 /****************************************************************************\r
2 **\r
3 ** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).\r
4 ** Contact: Qt Software Information (qt-info@nokia.com)\r
5 **\r
6 ** This file is part of the qmake spec of the Qt Toolkit.\r
7 **\r
8 ** Commercial Usage\r
9 ** Licensees holding valid Qt Commercial licenses may use this file in\r
10 ** accordance with the Qt Commercial License Agreement provided with the\r
11 ** Software or, alternatively, in accordance with the terms contained in\r
12 ** a written agreement between you and Nokia.\r
13 **\r
14 **\r
15 ** GNU General Public License Usage\r
16 ** Alternatively, this file may be used under the terms of the GNU\r
17 ** General Public License versions 2.0 or 3.0 as published by the Free\r
18 ** Software Foundation and appearing in the file LICENSE.GPL included in\r
19 ** the packaging of this file.  Please review the following information\r
20 ** to ensure GNU General Public Licensing requirements will be met:\r
21 ** http://www.fsf.org/licensing/licenses/info/GPLv2.html and\r
22 ** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special\r
23 ** exception, Nokia gives you certain additional rights. These rights\r
24 ** are described in the Nokia Qt GPL Exception version 1.3, included in\r
25 ** the file GPL_EXCEPTION.txt in this package.\r
26 **\r
27 ** Qt for Windows(R) Licensees\r
28 ** As a special exception, Nokia, as the sole copyright holder for Qt\r
29 ** Designer, grants users of the Qt/Eclipse Integration plug-in the\r
30 ** right for the Qt/Eclipse Integration to link to functionality\r
31 ** provided by Qt Designer and its related libraries.\r
32 **\r
33 ** If you are unsure which license is appropriate for your use, please\r
34 ** contact the sales department at qt-sales@nokia.com.\r
35 **\r
36 ****************************************************************************/\r
37 \r
38 #ifndef QPLATFORMDEFS_H\r
39 #define QPLATFORMDEFS_H\r
40 \r
41 #ifdef UNICODE\r
42 #ifndef _UNICODE\r
43 #define _UNICODE\r
44 #endif\r
45 #endif\r
46 \r
47 // Get Qt defines/settings\r
48 \r
49 #include "qglobal.h"\r
50 \r
51 #include <tchar.h>\r
52 #include <io.h>\r
53 #include <direct.h>\r
54 #include <stdio.h>\r
55 #include <fcntl.h>\r
56 #include <errno.h>\r
57 #include <sys/stat.h>\r
58 #include <stdlib.h>\r
59 #include <windows.h>\r
60 #include <limits.h>\r
61 \r
62 #if !defined(_WIN32_WINNT) || (_WIN32_WINNT-0 < 0x0500)\r
63 typedef enum {\r
64     NameUnknown           = 0, \r
65     NameFullyQualifiedDN  = 1, \r
66     NameSamCompatible     = 2, \r
67     NameDisplay           = 3, \r
68     NameUniqueId          = 6, \r
69     NameCanonical         = 7, \r
70     NameUserPrincipal     = 8, \r
71     NameCanonicalEx       = 9, \r
72     NameServicePrincipal  = 10, \r
73     NameDnsDomain         = 12\r
74 } EXTENDED_NAME_FORMAT, *PEXTENDED_NAME_FORMAT;\r
75 #endif\r
76 \r
77 #define Q_FS_FAT\r
78 #ifdef QT_LARGEFILE_SUPPORT\r
79 #define QT_STATBUF              struct _stati64         // non-ANSI defs\r
80 #define QT_STATBUF4TSTAT        struct _stati64         // non-ANSI defs\r
81 #define QT_STAT                 ::_stati64\r
82 #define QT_FSTAT                ::_fstati64\r
83 #else\r
84 #define QT_STATBUF              struct _stat            // non-ANSI defs\r
85 #define QT_STATBUF4TSTAT        struct _stat            // non-ANSI defs\r
86 #define QT_STAT                 ::_stat\r
87 #define QT_FSTAT                ::_fstat\r
88 #endif\r
89 #define QT_STAT_REG             _S_IFREG\r
90 #define QT_STAT_DIR             _S_IFDIR\r
91 #define QT_STAT_MASK            _S_IFMT\r
92 #if defined(_S_IFLNK)\r
93 #  define QT_STAT_LNK           _S_IFLNK\r
94 #endif\r
95 #define QT_FILENO               _fileno\r
96 #define QT_OPEN                 ::_open\r
97 #define QT_CLOSE                ::_close\r
98 #ifdef QT_LARGEFILE_SUPPORT\r
99 #define QT_LSEEK                ::_lseeki64\r
100 #ifndef UNICODE\r
101 #define QT_TSTAT                ::_stati64\r
102 #else\r
103 #define QT_TSTAT                ::_wstati64\r
104 #endif\r
105 #else\r
106 #define QT_LSEEK                ::_lseek\r
107 #ifndef UNICODE\r
108 #define QT_TSTAT                ::_stat\r
109 #else\r
110 #define QT_TSTAT                ::_wstat\r
111 #endif\r
112 #endif\r
113 #define QT_READ                 ::_read\r
114 #define QT_WRITE                ::_write\r
115 #define QT_ACCESS               ::_access\r
116 #define QT_GETCWD               ::_getcwd\r
117 #define QT_CHDIR                ::_chdir\r
118 #define QT_MKDIR                ::_mkdir\r
119 #define QT_RMDIR                ::_rmdir\r
120 #define QT_OPEN_LARGEFILE       0\r
121 #define QT_OPEN_RDONLY          _O_RDONLY\r
122 #define QT_OPEN_WRONLY          _O_WRONLY\r
123 #define QT_OPEN_RDWR            _O_RDWR\r
124 #define QT_OPEN_CREAT           _O_CREAT\r
125 #define QT_OPEN_TRUNC           _O_TRUNC\r
126 #define QT_OPEN_APPEND          _O_APPEND\r
127 #if defined(O_TEXT)\r
128 # define QT_OPEN_TEXT           _O_TEXT\r
129 # define QT_OPEN_BINARY         _O_BINARY\r
130 #endif\r
131 \r
132 #define QT_FOPEN                ::fopen\r
133 #ifdef QT_LARGEFILE_SUPPORT\r
134 #define QT_FSEEK                ::fseeko64\r
135 #define QT_FTELL                ::ftello64\r
136 #else\r
137 #define QT_FSEEK                ::fseek\r
138 #define QT_FTELL                ::ftell\r
139 #endif\r
140 #define QT_FGETPOS              ::fgetpos\r
141 #define QT_FSETPOS              ::fsetpos\r
142 #define QT_FPOS_T               fpos_t\r
143 #ifdef QT_LARGEFILE_SUPPORT\r
144 #define QT_OFF_T                off64_t\r
145 #else\r
146 #define QT_OFF_T                long\r
147 #endif\r
148 \r
149 #define QT_SIGNAL_ARGS          int\r
150 \r
151 #define QT_VSNPRINTF            ::_vsnprintf\r
152 #define QT_SNPRINTF             ::_snprintf\r
153 \r
154 # define F_OK   0\r
155 # define X_OK   1\r
156 # define W_OK   2\r
157 # define R_OK   4\r
158 \r
159 \r
160 #endif // QPLATFORMDEFS_H\r