qplatformdefs.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /****************************************************************************
  2. **
  3. ** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
  4. **
  5. ** This file is part of the qmake spec of the Qt Toolkit.
  6. **
  7. ** This file may be used under the terms of the GNU General Public
  8. ** License version 2.0 as published by the Free Software Foundation
  9. ** and appearing in the file LICENSE.GPL included in the packaging of
  10. ** this file. Please review the following information to ensure GNU
  11. ** General Public Licensing requirements will be met:
  12. ** http://www.trolltech.com/products/qt/opensource.html
  13. **
  14. ** If you are unsure which license is appropriate for your use, please
  15. ** review the following information:
  16. ** http://www.trolltech.com/products/qt/licensing.html or contact the
  17. ** sales department at sales@trolltech.com.
  18. **
  19. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. **
  22. ****************************************************************************/
  23. #ifndef QPLATFORMDEFS_H
  24. #define QPLATFORMDEFS_H
  25. #ifdef UNICODE
  26. #ifndef _UNICODE
  27. #define _UNICODE
  28. #endif
  29. #endif
  30. // Get Qt defines/settings
  31. #include "qglobal.h"
  32. #include <tchar.h>
  33. #include <io.h>
  34. #include <direct.h>
  35. #include <stdio.h>
  36. #include <fcntl.h>
  37. #include <errno.h>
  38. #include <sys/stat.h>
  39. #include <stdlib.h>
  40. #include <windows.h>
  41. #include <limits.h>
  42. #if !defined(_WIN32_WINNT) || (_WIN32_WINNT-0 < 0x0500)
  43. typedef enum {
  44. NameUnknown = 0,
  45. NameFullyQualifiedDN = 1,
  46. NameSamCompatible = 2,
  47. NameDisplay = 3,
  48. NameUniqueId = 6,
  49. NameCanonical = 7,
  50. NameUserPrincipal = 8,
  51. NameCanonicalEx = 9,
  52. NameServicePrincipal = 10,
  53. NameDnsDomain = 12
  54. } EXTENDED_NAME_FORMAT, *PEXTENDED_NAME_FORMAT;
  55. #endif
  56. #define Q_FS_FAT
  57. #ifdef QT_LARGEFILE_SUPPORT
  58. #define QT_STATBUF struct _stati64 // non-ANSI defs
  59. #define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
  60. #define QT_STAT ::_stati64
  61. #define QT_FSTAT ::_fstati64
  62. #else
  63. #define QT_STATBUF struct _stat // non-ANSI defs
  64. #define QT_STATBUF4TSTAT struct _stat // non-ANSI defs
  65. #define QT_STAT ::_stat
  66. #define QT_FSTAT ::_fstat
  67. #endif
  68. #define QT_STAT_REG _S_IFREG
  69. #define QT_STAT_DIR _S_IFDIR
  70. #define QT_STAT_MASK _S_IFMT
  71. #if defined(_S_IFLNK)
  72. # define QT_STAT_LNK _S_IFLNK
  73. #endif
  74. #define QT_FILENO _fileno
  75. #define QT_OPEN ::_open
  76. #define QT_CLOSE ::_close
  77. #ifdef QT_LARGEFILE_SUPPORT
  78. #define QT_LSEEK ::_lseeki64
  79. #ifndef UNICODE
  80. #define QT_TSTAT ::_stati64
  81. #else
  82. #define QT_TSTAT ::_wstati64
  83. #endif
  84. #else
  85. #define QT_LSEEK ::_lseek
  86. #ifndef UNICODE
  87. #define QT_TSTAT ::_stat
  88. #else
  89. #define QT_TSTAT ::_wstat
  90. #endif
  91. #endif
  92. #define QT_READ ::_read
  93. #define QT_WRITE ::_write
  94. #define QT_ACCESS ::_access
  95. #define QT_GETCWD ::_getcwd
  96. #define QT_CHDIR ::_chdir
  97. #define QT_MKDIR ::_mkdir
  98. #define QT_RMDIR ::_rmdir
  99. #define QT_OPEN_LARGEFILE 0
  100. #define QT_OPEN_RDONLY _O_RDONLY
  101. #define QT_OPEN_WRONLY _O_WRONLY
  102. #define QT_OPEN_RDWR _O_RDWR
  103. #define QT_OPEN_CREAT _O_CREAT
  104. #define QT_OPEN_TRUNC _O_TRUNC
  105. #define QT_OPEN_APPEND _O_APPEND
  106. #if defined(O_TEXT)
  107. # define QT_OPEN_TEXT _O_TEXT
  108. # define QT_OPEN_BINARY _O_BINARY
  109. #endif
  110. #define QT_FOPEN ::fopen
  111. #ifdef QT_LARGEFILE_SUPPORT
  112. #define QT_FSEEK ::fseeko64
  113. #define QT_FTELL ::ftello64
  114. #else
  115. #define QT_FSEEK ::fseek
  116. #define QT_FTELL ::ftell
  117. #endif
  118. #define QT_FGETPOS ::fgetpos
  119. #define QT_FSETPOS ::fsetpos
  120. #define QT_FPOS_T fpos_t
  121. #ifdef QT_LARGEFILE_SUPPORT
  122. #define QT_OFF_T off64_t
  123. #else
  124. #define QT_OFF_T long
  125. #endif
  126. #define QT_SIGNAL_ARGS int
  127. #define QT_VSNPRINTF ::_vsnprintf
  128. #define QT_SNPRINTF ::_snprintf
  129. # define F_OK 0
  130. # define X_OK 1
  131. # define W_OK 2
  132. # define R_OK 4
  133. #endif // QPLATFORMDEFS_H