~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to mkspecs/linux-g++/qplatformdefs.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
// 1) need to reset default environment if _BSD_SOURCE is defined
 
11
// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0
 
12
// 3) it seems older glibc need this to include the X/Open stuff
 
13
#ifndef _GNU_SOURCE
 
14
#  define _GNU_SOURCE
 
15
#endif
 
16
 
 
17
#include <unistd.h>
 
18
 
 
19
 
 
20
// We are hot - unistd.h should have turned on the specific APIs we requested
 
21
 
 
22
 
 
23
#include <pthread.h>
 
24
#include <dirent.h>
 
25
#include <fcntl.h>
 
26
#include <grp.h>
 
27
#include <pwd.h>
 
28
#include <signal.h>
 
29
#include <dlfcn.h>
 
30
 
 
31
#include <sys/types.h>
 
32
#include <sys/ioctl.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
#include <netinet/in.h>
 
40
 
 
41
#ifdef QT_LARGEFILE_SUPPORT
 
42
#define QT_STATBUF              struct stat64
 
43
#define QT_STATBUF4TSTAT        struct stat64
 
44
#define QT_STAT                 ::stat64
 
45
#define QT_FSTAT                ::fstat64
 
46
#define QT_LSTAT                ::lstat64
 
47
#define QT_OPEN                 ::open64
 
48
#define QT_TRUNCATE             ::truncate64
 
49
#define QT_FTRUNCATE            ::ftruncate64
 
50
#define QT_LSEEK                ::lseek64
 
51
#else
 
52
#define QT_STATBUF              struct stat
 
53
#define QT_STATBUF4TSTAT        struct stat
 
54
#define QT_STAT                 ::stat
 
55
#define QT_FSTAT                ::fstat
 
56
#define QT_LSTAT                ::lstat
 
57
#define QT_OPEN                 ::open
 
58
#define QT_TRUNCATE             ::truncate
 
59
#define QT_FTRUNCATE            ::ftruncate
 
60
#define QT_LSEEK                ::lseek
 
61
#endif
 
62
 
 
63
#define QT_STAT_REG             S_IFREG
 
64
#define QT_STAT_DIR             S_IFDIR
 
65
#define QT_STAT_MASK            S_IFMT
 
66
#define QT_STAT_LNK             S_IFLNK
 
67
#define QT_SOCKET_CONNECT       ::connect
 
68
#define QT_SOCKET_BIND          ::bind
 
69
#define QT_SOCKET_BIND          ::bind
 
70
#define QT_FILENO               fileno
 
71
#define QT_CLOSE                ::close
 
72
#define QT_READ                 ::read
 
73
#define QT_WRITE                ::write
 
74
#define QT_ACCESS               ::access
 
75
#define QT_GETCWD               ::getcwd
 
76
#define QT_CHDIR                ::chdir
 
77
#define QT_MKDIR                ::mkdir
 
78
#define QT_RMDIR                ::rmdir
 
79
#define QT_OPEN_RDONLY          O_RDONLY
 
80
#define QT_OPEN_WRONLY          O_WRONLY
 
81
#define QT_OPEN_RDWR            O_RDWR
 
82
#define QT_OPEN_CREAT           O_CREAT
 
83
#define QT_OPEN_TRUNC           O_TRUNC
 
84
#define QT_OPEN_APPEND          O_APPEND
 
85
 
 
86
#define QT_SIGNAL_RETTYPE       void
 
87
#define QT_SIGNAL_ARGS          int
 
88
#define QT_SIGNAL_IGNORE        SIG_IGN
 
89
 
 
90
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
 
91
#define QT_SOCKLEN_T            socklen_t
 
92
#else
 
93
#define QT_SOCKLEN_T            int
 
94
#endif
 
95
 
 
96
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
 
97
#define QT_SNPRINTF             ::snprintf
 
98
#define QT_VSNPRINTF            ::vsnprintf
 
99
#endif
 
100
 
 
101
 
 
102
#endif // QPLATFORMDEFS_H