77 #include <netinet/in.h> |
77 #include <netinet/in.h> |
78 #ifndef QT_NO_IPV6IFNAME |
78 #ifndef QT_NO_IPV6IFNAME |
79 #include <net/if.h> |
79 #include <net/if.h> |
80 #endif |
80 #endif |
81 |
81 |
82 // On 64-bit platforms sockets use socklen_t |
82 #define QT_USE_XOPEN_LFS_EXTENSIONS |
83 #define QT_SOCKLEN_T socklen_t |
83 #include "../common/posix/qplatformdefs.h" |
84 |
84 |
85 // Only Solaris 7 and better support 64-bit |
85 #undef QT_SOCKET_CONNECT |
86 #define QT_SNPRINTF ::snprintf |
86 #define QT_SOCKET_CONNECT qt_socket_connect |
87 #define QT_VSNPRINTF ::vsnprintf |
|
88 |
87 |
89 // Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED |
88 // Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED |
90 static inline int qt_socket_connect(int s, struct sockaddr *addr, QT_SOCKLEN_T addrlen) |
89 static inline int qt_socket_connect(int s, struct sockaddr *addr, QT_SOCKLEN_T addrlen) |
91 { return ::connect(s, addr, addrlen); } |
90 { return ::connect(s, addr, addrlen); } |
92 #if defined (connect) |
91 #if defined (connect) |
98 { return ::bind(s, addr, addrlen); } |
97 { return ::bind(s, addr, addrlen); } |
99 #if defined(bind) |
98 #if defined(bind) |
100 # undef bind |
99 # undef bind |
101 #endif |
100 #endif |
102 |
101 |
103 #ifdef QT_LARGEFILE_SUPPORT |
102 // Only Solaris 7 and better support 64-bit |
104 #define QT_STATBUF struct stat64 |
103 #define QT_SNPRINTF ::snprintf |
105 #define QT_STATBUF4TSTAT struct stat64 |
104 #define QT_VSNPRINTF ::vsnprintf |
106 #define QT_STAT ::stat64 |
|
107 #define QT_FSTAT ::fstat64 |
|
108 #define QT_LSTAT ::lstat64 |
|
109 #define QT_OPEN ::open64 |
|
110 #define QT_TRUNCATE ::truncate64 |
|
111 #define QT_FTRUNCATE ::ftruncate64 |
|
112 #define QT_LSEEK ::lseek64 |
|
113 #else |
|
114 #define QT_STATBUF struct stat |
|
115 #define QT_STATBUF4TSTAT struct stat |
|
116 #define QT_STAT ::stat |
|
117 #define QT_FSTAT ::fstat |
|
118 #define QT_LSTAT ::lstat |
|
119 #define QT_OPEN ::open |
|
120 #define QT_TRUNCATE ::truncate |
|
121 #define QT_FTRUNCATE ::ftruncate |
|
122 #define QT_LSEEK ::lseek |
|
123 #endif |
|
124 |
|
125 #ifdef QT_LARGEFILE_SUPPORT |
|
126 #define QT_FOPEN ::fopen64 |
|
127 #define QT_FSEEK ::fseeko64 |
|
128 #define QT_FTELL ::ftello64 |
|
129 #define QT_FGETPOS ::fgetpos64 |
|
130 #define QT_FSETPOS ::fsetpos64 |
|
131 #define QT_MMAP ::mmap64 |
|
132 #define QT_FPOS_T fpos64_t |
|
133 #define QT_OFF_T off64_t |
|
134 #else |
|
135 #define QT_FOPEN ::fopen |
|
136 #define QT_FSEEK ::fseek |
|
137 #define QT_FTELL ::ftell |
|
138 #define QT_FGETPOS ::fgetpos |
|
139 #define QT_FSETPOS ::fsetpos |
|
140 #define QT_MMAP ::mmap |
|
141 #define QT_FPOS_T fpos_t |
|
142 #define QT_OFF_T long |
|
143 #endif |
|
144 |
|
145 #define QT_STAT_REG S_IFREG |
|
146 #define QT_STAT_DIR S_IFDIR |
|
147 #define QT_STAT_MASK S_IFMT |
|
148 #define QT_STAT_LNK S_IFLNK |
|
149 #define QT_SOCKET_CONNECT qt_socket_connect |
|
150 #define QT_SOCKET_BIND ::bind |
|
151 #define QT_FILENO fileno |
|
152 #define QT_CLOSE ::close |
|
153 #define QT_READ ::read |
|
154 #define QT_WRITE ::write |
|
155 #define QT_ACCESS ::access |
|
156 #define QT_GETCWD ::getcwd |
|
157 #define QT_CHDIR ::chdir |
|
158 #define QT_MKDIR ::mkdir |
|
159 #define QT_RMDIR ::rmdir |
|
160 #define QT_OPEN_LARGEFILE O_LARGEFILE |
|
161 #define QT_OPEN_RDONLY O_RDONLY |
|
162 #define QT_OPEN_WRONLY O_WRONLY |
|
163 #define QT_OPEN_RDWR O_RDWR |
|
164 #define QT_OPEN_CREAT O_CREAT |
|
165 #define QT_OPEN_TRUNC O_TRUNC |
|
166 #define QT_OPEN_APPEND O_APPEND |
|
167 |
|
168 #define QT_SIGNAL_RETTYPE void |
|
169 #define QT_SIGNAL_ARGS int |
|
170 #define QT_SIGNAL_IGNORE SIG_IGN |
|
171 |
105 |
172 #endif // QPLATFORMDEFS_H |
106 #endif // QPLATFORMDEFS_H |