Diffstat (limited to 'mkspecs/solaris-kcc/qplatformdefs.h') (more/less context) (show whitespace changes)
-rw-r--r-- | mkspecs/solaris-kcc/qplatformdefs.h | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/mkspecs/solaris-kcc/qplatformdefs.h b/mkspecs/solaris-kcc/qplatformdefs.h new file mode 100644 index 0000000..db8bf71 --- a/dev/null +++ b/mkspecs/solaris-kcc/qplatformdefs.h | |||
@@ -0,0 +1,113 @@ | |||
1 | #ifndef QPLATFORMDEFS_H | ||
2 | #define QPLATFORMDEFS_H | ||
3 | |||
4 | // Get Qt defines/settings | ||
5 | |||
6 | #include "qglobal.h" | ||
7 | |||
8 | // Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs | ||
9 | |||
10 | #include <unistd.h> | ||
11 | |||
12 | |||
13 | // We are hot - unistd.h should have turned on the specific APIs we requested | ||
14 | |||
15 | |||
16 | #ifdef QT_THREAD_SUPPORT | ||
17 | #include <pthread.h> | ||
18 | #endif | ||
19 | |||
20 | #include <dirent.h> | ||
21 | #include <fcntl.h> | ||
22 | #include <grp.h> | ||
23 | #include <pwd.h> | ||
24 | #include <signal.h> | ||
25 | #include <dlfcn.h> | ||
26 | // KAI C++ has at the moment problems with unloading the Qt plugins. | ||
27 | // So don't unload them as a workaround for now. | ||
28 | #define QT_NO_LIBRARY_UNLOAD | ||
29 | |||
30 | #include <sys/types.h> | ||
31 | #include <sys/ioctl.h> | ||
32 | #include <sys/filio.h> | ||
33 | #include <sys/ipc.h> | ||
34 | #include <sys/time.h> | ||
35 | #include <sys/shm.h> | ||
36 | #include <sys/socket.h> | ||
37 | #include <sys/stat.h> | ||
38 | #include <sys/wait.h> | ||
39 | |||
40 | // DNS header files are not fully covered by X/Open specifications. | ||
41 | // In particular nothing is said about res_* :/ | ||
42 | // On Solaris header files <netinet/in.h> and <arpa/nameser.h> are not | ||
43 | // included by <resolv.h>. Note that <arpa/nameser.h> must be included | ||
44 | // before <resolv.h>. | ||
45 | #include <netinet/in.h> | ||
46 | #include <arpa/nameser.h> | ||
47 | #include <resolv.h> | ||
48 | |||
49 | |||
50 | #if !defined(QT_NO_COMPAT) | ||
51 | #define QT_STATBUF struct stat | ||
52 | #define QT_STATBUF4TSTATstruct stat | ||
53 | #define QT_STAT ::stat | ||
54 | #define QT_FSTAT ::fstat | ||
55 | #define QT_STAT_REG S_IFREG | ||
56 | #define QT_STAT_DIR S_IFDIR | ||
57 | #define QT_STAT_MASK S_IFMT | ||
58 | #define QT_STAT_LNK S_IFLNK | ||
59 | #define QT_FILENO fileno | ||
60 | #define QT_OPEN ::open | ||
61 | #define QT_CLOSE ::close | ||
62 | #define QT_LSEEK ::lseek | ||
63 | #define QT_READ ::read | ||
64 | #define QT_WRITE ::write | ||
65 | #define QT_ACCESS ::access | ||
66 | #define QT_GETCWD ::getcwd | ||
67 | #define QT_CHDIR ::chdir | ||
68 | #define QT_MKDIR ::mkdir | ||
69 | #define QT_RMDIR ::rmdir | ||
70 | #define QT_OPEN_RDONLY O_RDONLY | ||
71 | #define QT_OPEN_WRONLY O_WRONLY | ||
72 | #define QT_OPEN_RDWR O_RDWR | ||
73 | #define QT_OPEN_CREAT O_CREAT | ||
74 | #define QT_OPEN_TRUNC O_TRUNC | ||
75 | #define QT_OPEN_APPEND O_APPEND | ||
76 | #endif | ||
77 | |||
78 | #define QT_SIGNAL_RETTYPEvoid | ||
79 | #define QT_SIGNAL_ARGS int | ||
80 | #define QT_SIGNAL_IGNORESIG_IGN | ||
81 | |||
82 | #if !defined(_XOPEN_UNIX) | ||
83 | // Function usleep() is in C library but not in header files on Solaris 2.5.1. | ||
84 | // Not really a surprise, usleep() is specified by XPG4v2 and XPG4v2 is only | ||
85 | // supported by Solaris 2.6 and better. | ||
86 | // So we are trying to detect Solaris 2.5.1 using macro _XOPEN_UNIX which is | ||
87 | // not defined by <unistd.h> when XPG4v2 is not supported. | ||
88 | typedef unsigned int useconds_t; | ||
89 | extern "C" int usleep(useconds_t); | ||
90 | #endif | ||
91 | |||
92 | #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) && (_XOPEN_VERSION-0 >= 500) | ||
93 | // on Solaris 7 and better with specific feature test macros | ||
94 | #define QT_SOCKLEN_T socklen_t | ||
95 | #elif defined(_XOPEN_SOURCE_EXTENDED) && defined(_XOPEN_UNIX) | ||
96 | // on Solaris 2.6 and better with specific feature test macros | ||
97 | #define QT_SOCKLEN_T size_t | ||
98 | #else | ||
99 | // always this case in practice | ||
100 | #define QT_SOCKLEN_T int | ||
101 | #endif | ||
102 | |||
103 | #if defined(_XOPEN_UNIX) | ||
104 | // Supported by Solaris 2.6 and better. XPG4v2 and XPG4v2 is also supported | ||
105 | // by Solaris 2.6 and better. So we are trying to detect Solaris 2.6 using | ||
106 | // macro _XOPEN_UNIX which is not defined by <unistd.h> when XPG4v2 is not | ||
107 | // supported. | ||
108 | #define QT_SNPRINTF ::snprintf | ||
109 | #define QT_VSNPRINTF ::vsnprintf | ||
110 | #endif | ||
111 | |||
112 | |||
113 | #endif // QPLATFORMDEFS_H | ||