home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / mkspecs / linux-icc / qplatformdefs.h < prev   
C/C++ Source or Header  |  2001-12-03  |  3KB  |  100 lines

  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.  
  42. #include <sys/types.h>
  43. #include <sys/ioctl.h>
  44. #include <sys/ipc.h>
  45. #include <sys/time.h>
  46. #include <sys/shm.h>
  47. #include <sys/socket.h>
  48. #include <sys/stat.h>
  49. #include <sys/wait.h>
  50.  
  51. // DNS header files are not fully covered by X/Open specifications.
  52. // In particular nothing is said about res_* :/
  53. // Header files <netinet/in.h> and <arpa/nameser.h> are not included
  54. // by <resolv.h> on older versions of the GNU C library. Note that
  55. // <arpa/nameser.h> must be included before <resolv.h>.
  56. #include <netinet/in.h>
  57. #include <arpa/nameser.h>
  58. #include <resolv.h>
  59.  
  60.  
  61. #define QT_STATBUF        struct stat
  62. #define QT_STATBUF4TSTAT    struct stat
  63. #define QT_STAT            ::stat
  64. #define QT_FSTAT        ::fstat
  65. #define QT_STAT_REG        S_IFREG
  66. #define QT_STAT_DIR        S_IFDIR
  67. #define QT_STAT_MASK        S_IFMT
  68. #define QT_STAT_LNK        S_IFLNK
  69. #define QT_FILENO        fileno
  70. #define QT_OPEN            ::open
  71. #define QT_CLOSE        ::close
  72. #define QT_LSEEK        ::lseek
  73. #define QT_READ            ::read
  74. #define QT_WRITE        ::write
  75. #define QT_ACCESS        ::access
  76. #define QT_GETCWD        ::getcwd
  77. #define QT_CHDIR        ::chdir
  78. #define QT_MKDIR        ::mkdir
  79. #define QT_RMDIR        ::rmdir
  80. #define QT_OPEN_RDONLY        O_RDONLY
  81. #define QT_OPEN_WRONLY        O_WRONLY
  82. #define QT_OPEN_RDWR        O_RDWR
  83. #define QT_OPEN_CREAT        O_CREAT
  84. #define QT_OPEN_TRUNC        O_TRUNC
  85. #define QT_OPEN_APPEND        O_APPEND
  86.  
  87. #define QT_SIGNAL_RETTYPE    void
  88. #define QT_SIGNAL_ARGS        int
  89. #define QT_SIGNAL_IGNORE    SIG_IGN
  90.  
  91. #define QT_SOCKLEN_T        socklen_t
  92.  
  93. #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
  94. #define QT_SNPRINTF        ::snprintf
  95. #define QT_VSNPRINTF        ::vsnprintf
  96. #endif
  97.  
  98.  
  99. #endif // QPLATFORMDEFS_H
  100.