1 /****************************************************************************
3 ** Copyright (C) 2000-2007 TROLLTECH ASA. All rights reserved.
5 ** This file is part of the Opensource Edition of the Qtopia Toolkit.
7 ** This software is licensed under the terms of the GNU General Public
8 ** License (GPL) version 2.
10 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
12 ** Contact info@trolltech.com if any conditions of this licensing are
17 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 ****************************************************************************/
22 #ifndef QPLATFORMDEFS_H
23 #define QPLATFORMDEFS_H
25 // Get Qt defines/settings
29 // Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
31 // 1) need to reset default environment if _BSD_SOURCE is defined
32 // 2) need to specify POSIX thread interfaces explicitly in glibc 2.0
33 // 3) it seems older glibc need this to include the X/Open stuff
41 // We are hot - unistd.h should have turned on the specific APIs we requested
52 #include <sys/types.h>
53 #include <sys/ioctl.h>
57 #include <sys/socket.h>
60 #include <netinet/in.h>
61 #ifndef QT_NO_IPV6IFNAME
65 #ifdef QT_LARGEFILE_SUPPORT
66 #define QT_STATBUF struct stat64
67 #define QT_STATBUF4TSTAT struct stat64
68 #define QT_STAT ::stat64
69 #define QT_FSTAT ::fstat64
70 #define QT_LSTAT ::lstat64
71 #define QT_OPEN ::open64
72 #define QT_TRUNCATE ::truncate64
73 #define QT_FTRUNCATE ::ftruncate64
74 #define QT_LSEEK ::lseek64
76 #define QT_STATBUF struct stat
77 #define QT_STATBUF4TSTAT struct stat
78 #define QT_STAT ::stat
79 #define QT_FSTAT ::fstat
80 #define QT_LSTAT ::lstat
81 #define QT_OPEN ::open
82 #define QT_TRUNCATE ::truncate
83 #define QT_FTRUNCATE ::ftruncate
84 #define QT_LSEEK ::lseek
87 #ifdef QT_LARGEFILE_SUPPORT
88 #define QT_FOPEN ::fopen64
89 #define QT_FSEEK ::fseeko64
90 #define QT_FTELL ::ftello64
91 #define QT_FGETPOS ::fgetpos64
92 #define QT_FSETPOS ::fsetpos64
93 #define QT_FPOS_T fpos64_t
94 #define QT_OFF_T off64_t
96 #define QT_FOPEN ::fopen
97 #define QT_FSEEK ::fseek
98 #define QT_FTELL ::ftell
99 #define QT_FGETPOS ::fgetpos
100 #define QT_FSETPOS ::fsetpos
101 #define QT_FPOS_T fpos_t
102 #define QT_OFF_T long
105 #define QT_STAT_REG S_IFREG
106 #define QT_STAT_DIR S_IFDIR
107 #define QT_STAT_MASK S_IFMT
108 #define QT_STAT_LNK S_IFLNK
109 #define QT_SOCKET_CONNECT ::connect
110 #define QT_SOCKET_BIND ::bind
111 #define QT_SOCKET_BIND ::bind
112 #define QT_FILENO fileno
113 #define QT_CLOSE ::close
114 #define QT_READ ::read
115 #define QT_WRITE ::write
116 #define QT_ACCESS ::access
117 #define QT_GETCWD ::getcwd
118 #define QT_CHDIR ::chdir
119 #define QT_MKDIR ::mkdir
120 #define QT_RMDIR ::rmdir
121 #define QT_OPEN_LARGEFILE O_LARGEFILE
122 #define QT_OPEN_RDONLY O_RDONLY
123 #define QT_OPEN_WRONLY O_WRONLY
124 #define QT_OPEN_RDWR O_RDWR
125 #define QT_OPEN_CREAT O_CREAT
126 #define QT_OPEN_TRUNC O_TRUNC
127 #define QT_OPEN_APPEND O_APPEND
129 #define QT_SIGNAL_RETTYPE void
130 #define QT_SIGNAL_ARGS int
131 #define QT_SIGNAL_IGNORE SIG_IGN
133 #if defined(__GLIBC__) && (__GLIBC__ >= 2)
134 #define QT_SOCKLEN_T socklen_t
136 #define QT_SOCKLEN_T int
139 #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
140 #define QT_SNPRINTF ::snprintf
141 #define QT_VSNPRINTF ::vsnprintf
144 #define QT_QLOCALE_USES_FCVT
146 #endif // QPLATFORMDEFS_H