summaryrefslogtreecommitdiff
path: root/mkspecs/linux-kcc/qplatformdefs.h
Unidiff
Diffstat (limited to 'mkspecs/linux-kcc/qplatformdefs.h') (more/less context) (ignore whitespace changes)
-rw-r--r--mkspecs/linux-kcc/qplatformdefs.h109
1 files changed, 109 insertions, 0 deletions
diff --git a/mkspecs/linux-kcc/qplatformdefs.h b/mkspecs/linux-kcc/qplatformdefs.h
new file mode 100644
index 0000000..9df75e3
--- a/dev/null
+++ b/mkspecs/linux-kcc/qplatformdefs.h
@@ -0,0 +1,109 @@
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// DNS system header files are a mess!
11// <resolv.h> includes <arpa/nameser.h>. <arpa/nameser.h> is using
12// 'u_char' and includes <sys/types.h>. Now the problem is that
13// <sys/types.h> defines 'u_char' only if __USE_BSD is defined.
14// __USE_BSD is defined in <features.h> if _BSD_SOURCE is defined.
15#ifndef _BSD_SOURCE
16# define _BSD_SOURCE
17#endif
18
19// 1) need to reset default environment if _BSD_SOURCE is defined
20// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0
21// 3) it seems older glibc need this to include the X/Open stuff
22#ifndef _GNU_SOURCE
23# define _GNU_SOURCE
24#endif
25
26#include <unistd.h>
27
28
29// We are hot - unistd.h should have turned on the specific APIs we requested
30
31
32#ifdef QT_THREAD_SUPPORT
33#include <pthread.h>
34#endif
35
36#include <dirent.h>
37#include <fcntl.h>
38#include <grp.h>
39#include <pwd.h>
40#include <signal.h>
41#include <dlfcn.h>
42// KAI C++ has at the moment problems with unloading the Qt plugins.
43// So don't unload them as a workaround for now.
44#define QT_NO_LIBRARY_UNLOAD
45
46#include <sys/types.h>
47#include <sys/ioctl.h>
48#include <sys/ipc.h>
49#include <sys/time.h>
50#include <sys/shm.h>
51#include <sys/socket.h>
52#include <sys/stat.h>
53#include <sys/wait.h>
54
55// DNS header files are not fully covered by X/Open specifications.
56// In particular nothing is said about res_* :/
57// Header files <netinet/in.h> and <arpa/nameser.h> are not included
58// by <resolv.h> on older versions of the GNU C library. Note that
59// <arpa/nameser.h> must be included before <resolv.h>.
60#include <netinet/in.h>
61#include <arpa/nameser.h>
62#include <resolv.h>
63
64
65#if !defined(QT_NO_COMPAT)
66 #define QT_STATBUF struct stat
67 #define QT_STATBUF4TSTATstruct stat
68 #define QT_STAT ::stat
69 #define QT_FSTAT ::fstat
70 #define QT_STAT_REG S_IFREG
71 #define QT_STAT_DIR S_IFDIR
72 #define QT_STAT_MASK S_IFMT
73 #define QT_STAT_LNK S_IFLNK
74 #define QT_FILENO fileno
75 #define QT_OPEN ::open
76 #define QT_CLOSE ::close
77 #define QT_LSEEK ::lseek
78 #define QT_READ ::read
79 #define QT_WRITE ::write
80 #define QT_ACCESS ::access
81 #define QT_GETCWD ::getcwd
82 #define QT_CHDIR ::chdir
83 #define QT_MKDIR ::mkdir
84 #define QT_RMDIR ::rmdir
85 #define QT_OPEN_RDONLY O_RDONLY
86 #define QT_OPEN_WRONLY O_WRONLY
87 #define QT_OPEN_RDWR O_RDWR
88 #define QT_OPEN_CREAT O_CREAT
89 #define QT_OPEN_TRUNC O_TRUNC
90 #define QT_OPEN_APPEND O_APPEND
91#endif
92
93 #define QT_SIGNAL_RETTYPEvoid
94 #define QT_SIGNAL_ARGS int
95 #define QT_SIGNAL_IGNORESIG_IGN
96
97#if defined(__GLIBC__) && (__GLIBC__ >= 2)
98 #define QT_SOCKLEN_T socklen_t
99#else
100 #define QT_SOCKLEN_T int
101#endif
102
103#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
104 #define QT_SNPRINTF ::snprintf
105 #define QT_VSNPRINTF ::vsnprintf
106#endif
107
108
109#endif // QPLATFORMDEFS_H