mkspecs/win32-borland/qplatformdefs.h
changeset 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the qmake spec of the Qt Toolkit.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #ifndef QPLATFORMDEFS_H
       
    43 #define QPLATFORMDEFS_H
       
    44 
       
    45 #ifdef UNICODE
       
    46 #ifndef _UNICODE
       
    47 #define _UNICODE
       
    48 #endif
       
    49 #endif
       
    50 
       
    51 // Get Qt defines/settings
       
    52 
       
    53 #include "qglobal.h"
       
    54 #define Q_FS_FAT
       
    55 
       
    56 #define _POSIX_
       
    57 #include <limits.h>
       
    58 #undef _POSIX_
       
    59 
       
    60 #include <tchar.h>
       
    61 #include <io.h>
       
    62 #include <direct.h>
       
    63 #include <stdio.h>
       
    64 #include <fcntl.h>
       
    65 #include <errno.h>
       
    66 #include <sys/stat.h>
       
    67 #include <dos.h>
       
    68 #include <stdlib.h>
       
    69 #include <search.h>
       
    70 #include <windows.h>
       
    71 
       
    72 #if __BORLANDC__ >= 0x550
       
    73 // Borland Builder 6
       
    74 
       
    75 #ifdef QT_LARGEFILE_SUPPORT
       
    76 #  define QT_STATBUF		struct stati64		// non-ANSI defs
       
    77 #  define QT_STATBUF4TSTAT	struct stati64		// non-ANSI defs
       
    78 #  define QT_STAT		::_stati64
       
    79 #  define QT_FSTAT		::fstati64
       
    80 #  define QT_LSEEK		::_lseeki64
       
    81 #  define QT_TSTAT		::_tstati64
       
    82 #else
       
    83 #  define QT_STATBUF		struct stat		// non-ANSI defs
       
    84 #  define QT_STATBUF4TSTAT	struct _stat		// non-ANSI defs
       
    85 #  define QT_STAT		::stat
       
    86 #  define QT_FSTAT		::fstat
       
    87 #  define QT_LSEEK		::_lseek
       
    88 #  define QT_TSTAT		::_tstat
       
    89 #endif
       
    90 
       
    91 #define QT_STAT_REG		_S_IFREG
       
    92 #define QT_STAT_DIR		_S_IFDIR
       
    93 #define QT_STAT_MASK		_S_IFMT
       
    94 
       
    95 #if defined(_S_IFLNK)
       
    96 #  define QT_STAT_LNK		_S_IFLNK
       
    97 #endif
       
    98 
       
    99 #define QT_FOPEN                ::fopen
       
   100 #ifdef QT_LARGEFILE_SUPPORT
       
   101 #define QT_FSEEK                ::_fseeki64
       
   102 #define QT_FTELL                ::_ftelli64
       
   103 #else
       
   104 #define QT_FSEEK                ::fseek
       
   105 #define QT_FTELL                ::ftell
       
   106 #endif
       
   107 #define QT_FGETPOS              ::fgetpos
       
   108 #define QT_FSETPOS              ::fsetpos
       
   109 #define QT_FPOS_T               fpos_t
       
   110 #ifdef QT_LARGEFILE_SUPPORT
       
   111 #define QT_OFF_T                __int64
       
   112 #else
       
   113 #define QT_OFF_T                long
       
   114 #endif
       
   115 
       
   116 #define QT_FILENO		_fileno
       
   117 #define QT_OPEN			::open
       
   118 #define QT_CLOSE		::_close
       
   119 
       
   120 #define QT_READ			::_read
       
   121 #define QT_WRITE		::_write
       
   122 #define QT_ACCESS		::_access
       
   123 #define QT_GETCWD		::_getcwd
       
   124 #define QT_CHDIR		::chdir
       
   125 #define QT_MKDIR		::_mkdir
       
   126 #define QT_RMDIR		::_rmdir
       
   127 #define QT_OPEN_LARGEFILE       O_LARGEFILE
       
   128 #define QT_OPEN_RDONLY		_O_RDONLY
       
   129 #define QT_OPEN_WRONLY		_O_WRONLY
       
   130 #define QT_OPEN_RDWR		_O_RDWR
       
   131 #define QT_OPEN_CREAT		_O_CREAT
       
   132 #define QT_OPEN_TRUNC		_O_TRUNC
       
   133 #define QT_OPEN_APPEND		_O_APPEND
       
   134 
       
   135 #if defined(O_TEXT)
       
   136 #  define QT_OPEN_TEXT		_O_TEXT
       
   137 #  define QT_OPEN_BINARY	_O_BINARY
       
   138 #endif
       
   139 
       
   140 #else
       
   141 // Borland Builder 5
       
   142 
       
   143 #ifdef QT_LARGEFILE_SUPPORT
       
   144 #  define QT_STATBUF		struct stati64		// non-ANSI defs
       
   145 #  define QT_STATBUF4TSTAT	struct stati64		// non-ANSI defs
       
   146 #  define QT_STAT		::stati64
       
   147 #  define QT_FSTAT		::fstati64
       
   148 #  define QT_LSEEK		::lseeki64
       
   149 #  define QT_TSTAT		::tstati64
       
   150 #else
       
   151 #  define QT_STATBUF		struct stat		// non-ANSI defs
       
   152 #  define QT_STATBUF4TSTAT	struct stat		// non-ANSI defs
       
   153 #  define QT_STAT		::stat
       
   154 #  define QT_FSTAT		::fstat
       
   155 #  define QT_LSEEK		::lseek
       
   156 #  define QT_TSTAT		::tstat
       
   157 #endif
       
   158 
       
   159 #define QT_STAT_REG		S_IFREG
       
   160 #define QT_STAT_DIR		S_IFDIR
       
   161 #define QT_STAT_MASK		S_IFMT
       
   162 
       
   163 #if defined(S_IFLNK)
       
   164 #  define QT_STAT_LNK		S_IFLNK
       
   165 #endif
       
   166 
       
   167 #define QT_FILENO		fileno
       
   168 #define QT_OPEN			::open
       
   169 #define QT_CLOSE		::close
       
   170 
       
   171 #define QT_READ			::read
       
   172 #define QT_WRITE		::write
       
   173 #define QT_ACCESS		::access
       
   174 
       
   175 #if defined(Q_OS_OS2EMX)
       
   176     // This is documented in the un*x to OS/2-EMX Porting FAQ:
       
   177     // http://homepages.tu-darmstadt.de/~st002279/os2/porting.html
       
   178 #  define QT_GETCWD		::_getcwd2
       
   179 #  define QT_CHDIR		::_chdir2
       
   180 #else
       
   181 #  define QT_GETCWD		::getcwd
       
   182 #  define QT_CHDIR		::chdir
       
   183 #endif
       
   184 
       
   185 #define QT_MKDIR		::mkdir
       
   186 #define QT_RMDIR		::rmdir
       
   187 #define QT_OPEN_LARGEFILE       O_LARGEFILE
       
   188 #define QT_OPEN_RDONLY		O_RDONLY
       
   189 #define QT_OPEN_WRONLY		O_WRONLY
       
   190 #define QT_OPEN_RDWR		O_RDWR
       
   191 #define QT_OPEN_CREAT		O_CREAT
       
   192 #define QT_OPEN_TRUNC		O_TRUNC
       
   193 #define QT_OPEN_APPEND		O_APPEND
       
   194 
       
   195 #if defined(O_TEXT)
       
   196 #  define QT_OPEN_TEXT		O_TEXT
       
   197 #  define QT_OPEN_BINARY	O_BINARY
       
   198 #endif
       
   199 
       
   200 #endif // __BORLANDC__ >= 0x550
       
   201 
       
   202 // Borland Builder 5 and 6
       
   203 
       
   204 #define QT_SIGNAL_ARGS		int
       
   205 
       
   206 #define QT_VSNPRINTF		::_vsnprintf
       
   207 #define QT_SNPRINTF		::_snprintf
       
   208 
       
   209 # define F_OK	0
       
   210 # define X_OK	1
       
   211 # define W_OK	2
       
   212 # define R_OK	4
       
   213 
       
   214 
       
   215 #endif // QPLATFORMDEFS_H