Further fixes to file size handling on Windows with fd and FILE*
[qt-netbsd.git] / mkspecs / win32-g++ / qplatformdefs.h
blobcc5b14df7ec856570e1678f7c85b04bfa10077a8
1 /****************************************************************************
2 **
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
6 **
7 ** This file is part of the qmake spec of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** No Commercial Usage
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
14 ** this package.
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file. Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights. These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
38 ** $QT_END_LICENSE$
40 ****************************************************************************/
42 #ifndef QPLATFORMDEFS_H
43 #define QPLATFORMDEFS_H
45 #ifdef UNICODE
46 #ifndef _UNICODE
47 #define _UNICODE
48 #endif
49 #endif
51 // Get Qt defines/settings
53 #include "qglobal.h"
55 #include <tchar.h>
56 #include <io.h>
57 #include <direct.h>
58 #include <stdio.h>
59 #include <fcntl.h>
60 #include <errno.h>
61 #include <sys/stat.h>
62 #include <stdlib.h>
63 #include <qt_windows.h>
64 #include <limits.h>
66 #if !defined(_WIN32_WINNT) || (_WIN32_WINNT-0 < 0x0500)
67 typedef enum {
68 NameUnknown = 0,
69 NameFullyQualifiedDN = 1,
70 NameSamCompatible = 2,
71 NameDisplay = 3,
72 NameUniqueId = 6,
73 NameCanonical = 7,
74 NameUserPrincipal = 8,
75 NameCanonicalEx = 9,
76 NameServicePrincipal = 10,
77 NameDnsDomain = 12
78 } EXTENDED_NAME_FORMAT, *PEXTENDED_NAME_FORMAT;
79 #endif
81 #define Q_FS_FAT
82 #ifdef QT_LARGEFILE_SUPPORT
83 #define QT_STATBUF struct _stati64 // non-ANSI defs
84 #define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
85 #define QT_STAT ::_stati64
86 #define QT_FSTAT ::_fstati64
87 #else
88 #define QT_STATBUF struct _stat // non-ANSI defs
89 #define QT_STATBUF4TSTAT struct _stat // non-ANSI defs
90 #define QT_STAT ::_stat
91 #define QT_FSTAT ::_fstat
92 #endif
93 #define QT_STAT_REG _S_IFREG
94 #define QT_STAT_DIR _S_IFDIR
95 #define QT_STAT_MASK _S_IFMT
96 #if defined(_S_IFLNK)
97 # define QT_STAT_LNK _S_IFLNK
98 #endif
99 #define QT_FILENO _fileno
100 #define QT_OPEN ::_open
101 #define QT_CLOSE ::_close
102 #ifdef QT_LARGEFILE_SUPPORT
103 #define QT_LSEEK ::_lseeki64
104 #ifndef UNICODE
105 #define QT_TSTAT ::_stati64
106 #else
107 #define QT_TSTAT ::_wstati64
108 #endif
109 #else
110 #define QT_LSEEK ::_lseek
111 #ifndef UNICODE
112 #define QT_TSTAT ::_stat
113 #else
114 #define QT_TSTAT ::_wstat
115 #endif
116 #endif
117 #define QT_READ ::_read
118 #define QT_WRITE ::_write
119 #define QT_ACCESS ::_access
120 #define QT_GETCWD ::_getcwd
121 #define QT_CHDIR ::_chdir
122 #define QT_MKDIR ::_mkdir
123 #define QT_RMDIR ::_rmdir
124 #define QT_OPEN_LARGEFILE 0
125 #define QT_OPEN_RDONLY _O_RDONLY
126 #define QT_OPEN_WRONLY _O_WRONLY
127 #define QT_OPEN_RDWR _O_RDWR
128 #define QT_OPEN_CREAT _O_CREAT
129 #define QT_OPEN_TRUNC _O_TRUNC
130 #define QT_OPEN_APPEND _O_APPEND
131 #if defined(O_TEXT)
132 # define QT_OPEN_TEXT _O_TEXT
133 # define QT_OPEN_BINARY _O_BINARY
134 #endif
136 #define QT_FOPEN ::fopen
137 #ifdef QT_LARGEFILE_SUPPORT
138 #define QT_FSEEK ::fseeko64
139 #define QT_FTELL ::ftello64
140 #else
141 #define QT_FSEEK ::fseek
142 #define QT_FTELL ::ftell
143 #endif
144 #define QT_FGETPOS ::fgetpos
145 #define QT_FSETPOS ::fsetpos
146 #define QT_FPOS_T fpos_t
147 #ifdef QT_LARGEFILE_SUPPORT
148 #define QT_OFF_T off64_t
149 #else
150 #define QT_OFF_T long
151 #endif
153 #define QT_SIGNAL_ARGS int
155 #define QT_VSNPRINTF ::_vsnprintf
156 #define QT_SNPRINTF ::_snprintf
158 # define F_OK 0
159 # define X_OK 1
160 # define W_OK 2
161 # define R_OK 4
164 #endif // QPLATFORMDEFS_H