merge of '0b604857bbf871639fdb43ee8380222e8ef64bb7'
[vuplus_openembedded] / packages / qtopia-phone / files / fic-gta01 / qplatformdefs.h
1 /****************************************************************************
2 **
3 ** Copyright (C) 2000-2007 TROLLTECH ASA. All rights reserved.
4 **
5 ** This file is part of the Opensource Edition of the Qtopia Toolkit.
6 **
7 ** This software is licensed under the terms of the GNU General Public
8 ** License (GPL) version 2.
9 **
10 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
11 **
12 ** Contact info@trolltech.com if any conditions of this licensing are
13 ** not clear to you.
14 **
15 **
16 **
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.
19 **
20 ****************************************************************************/
21
22 #ifndef QPLATFORMDEFS_H
23 #define QPLATFORMDEFS_H
24
25 // Get Qt defines/settings
26
27 #include "qglobal.h"
28
29 // Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
30
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
34 #ifndef _GNU_SOURCE
35 #  define _GNU_SOURCE
36 #endif
37
38 #include <unistd.h>
39
40
41 // We are hot - unistd.h should have turned on the specific APIs we requested
42
43 #include <features.h>
44 #include <pthread.h>
45 #include <dirent.h>
46 #include <fcntl.h>
47 #include <grp.h>
48 #include <pwd.h>
49 #include <signal.h>
50 #include <dlfcn.h>
51
52 #include <sys/types.h>
53 #include <sys/ioctl.h>
54 #include <sys/ipc.h>
55 #include <sys/time.h>
56 #include <sys/shm.h>
57 #include <sys/socket.h>
58 #include <sys/stat.h>
59 #include <sys/wait.h>
60 #include <netinet/in.h>
61 #ifndef QT_NO_IPV6IFNAME
62 #include <net/if.h>
63 #endif
64
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
75 #else
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
85 #endif
86
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
95 #else
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
103 #endif
104
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
128
129 #define QT_SIGNAL_RETTYPE       void
130 #define QT_SIGNAL_ARGS          int
131 #define QT_SIGNAL_IGNORE        SIG_IGN
132
133 #if defined(__GLIBC__) && (__GLIBC__ >= 2)
134 #define QT_SOCKLEN_T            socklen_t
135 #else
136 #define QT_SOCKLEN_T            int
137 #endif
138
139 #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
140 #define QT_SNPRINTF             ::snprintf
141 #define QT_VSNPRINTF            ::vsnprintf
142 #endif
143
144 #define QT_QLOCALE_USES_FCVT
145
146 #endif // QPLATFORMDEFS_H