Working, but minimal Qt package.
[fedora-mingw.git] / qt-win / qplatformdefs.h
diff --git a/qt-win/qplatformdefs.h b/qt-win/qplatformdefs.h
new file mode 100644 (file)
index 0000000..30e5945
--- /dev/null
@@ -0,0 +1,160 @@
+/****************************************************************************\r
+**\r
+** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).\r
+** Contact: Qt Software Information (qt-info@nokia.com)\r
+**\r
+** This file is part of the qmake spec of the Qt Toolkit.\r
+**\r
+** Commercial Usage\r
+** Licensees holding valid Qt Commercial licenses may use this file in\r
+** accordance with the Qt Commercial License Agreement provided with the\r
+** Software or, alternatively, in accordance with the terms contained in\r
+** a written agreement between you and Nokia.\r
+**\r
+**\r
+** GNU General Public License Usage\r
+** Alternatively, this file may be used under the terms of the GNU\r
+** General Public License versions 2.0 or 3.0 as published by the Free\r
+** Software Foundation and appearing in the file LICENSE.GPL included in\r
+** the packaging of this file.  Please review the following information\r
+** to ensure GNU General Public Licensing requirements will be met:\r
+** http://www.fsf.org/licensing/licenses/info/GPLv2.html and\r
+** http://www.gnu.org/copyleft/gpl.html.  In addition, as a special\r
+** exception, Nokia gives you certain additional rights. These rights\r
+** are described in the Nokia Qt GPL Exception version 1.3, included in\r
+** the file GPL_EXCEPTION.txt in this package.\r
+**\r
+** Qt for Windows(R) Licensees\r
+** As a special exception, Nokia, as the sole copyright holder for Qt\r
+** Designer, grants users of the Qt/Eclipse Integration plug-in the\r
+** right for the Qt/Eclipse Integration to link to functionality\r
+** provided by Qt Designer and its related libraries.\r
+**\r
+** If you are unsure which license is appropriate for your use, please\r
+** contact the sales department at qt-sales@nokia.com.\r
+**\r
+****************************************************************************/\r
+\r
+#ifndef QPLATFORMDEFS_H\r
+#define QPLATFORMDEFS_H\r
+\r
+#ifdef UNICODE\r
+#ifndef _UNICODE\r
+#define _UNICODE\r
+#endif\r
+#endif\r
+\r
+// Get Qt defines/settings\r
+\r
+#include "qglobal.h"\r
+\r
+#include <tchar.h>\r
+#include <io.h>\r
+#include <direct.h>\r
+#include <stdio.h>\r
+#include <fcntl.h>\r
+#include <errno.h>\r
+#include <sys/stat.h>\r
+#include <stdlib.h>\r
+#include <windows.h>\r
+#include <limits.h>\r
+\r
+#if !defined(_WIN32_WINNT) || (_WIN32_WINNT-0 < 0x0500)\r
+typedef enum {\r
+    NameUnknown                  = 0, \r
+    NameFullyQualifiedDN  = 1, \r
+    NameSamCompatible    = 2, \r
+    NameDisplay                  = 3, \r
+    NameUniqueId         = 6, \r
+    NameCanonical        = 7, \r
+    NameUserPrincipal    = 8, \r
+    NameCanonicalEx      = 9, \r
+    NameServicePrincipal  = 10, \r
+    NameDnsDomain        = 12\r
+} EXTENDED_NAME_FORMAT, *PEXTENDED_NAME_FORMAT;\r
+#endif\r
+\r
+#define Q_FS_FAT\r
+#ifdef QT_LARGEFILE_SUPPORT\r
+#define QT_STATBUF             struct _stati64         // non-ANSI defs\r
+#define QT_STATBUF4TSTAT       struct _stati64         // non-ANSI defs\r
+#define QT_STAT                        ::_stati64\r
+#define QT_FSTAT               ::_fstati64\r
+#else\r
+#define QT_STATBUF             struct _stat            // non-ANSI defs\r
+#define QT_STATBUF4TSTAT       struct _stat            // non-ANSI defs\r
+#define QT_STAT                        ::_stat\r
+#define QT_FSTAT               ::_fstat\r
+#endif\r
+#define QT_STAT_REG            _S_IFREG\r
+#define QT_STAT_DIR            _S_IFDIR\r
+#define QT_STAT_MASK           _S_IFMT\r
+#if defined(_S_IFLNK)\r
+#  define QT_STAT_LNK          _S_IFLNK\r
+#endif\r
+#define QT_FILENO              _fileno\r
+#define QT_OPEN                        ::_open\r
+#define QT_CLOSE               ::_close\r
+#ifdef QT_LARGEFILE_SUPPORT\r
+#define QT_LSEEK               ::_lseeki64\r
+#ifndef UNICODE\r
+#define QT_TSTAT               ::_stati64\r
+#else\r
+#define QT_TSTAT               ::_wstati64\r
+#endif\r
+#else\r
+#define QT_LSEEK               ::_lseek\r
+#ifndef UNICODE\r
+#define QT_TSTAT               ::_stat\r
+#else\r
+#define QT_TSTAT               ::_wstat\r
+#endif\r
+#endif\r
+#define QT_READ                        ::_read\r
+#define QT_WRITE               ::_write\r
+#define QT_ACCESS              ::_access\r
+#define QT_GETCWD              ::_getcwd\r
+#define QT_CHDIR               ::_chdir\r
+#define QT_MKDIR               ::_mkdir\r
+#define QT_RMDIR               ::_rmdir\r
+#define QT_OPEN_LARGEFILE       0\r
+#define QT_OPEN_RDONLY         _O_RDONLY\r
+#define QT_OPEN_WRONLY         _O_WRONLY\r
+#define QT_OPEN_RDWR           _O_RDWR\r
+#define QT_OPEN_CREAT          _O_CREAT\r
+#define QT_OPEN_TRUNC          _O_TRUNC\r
+#define QT_OPEN_APPEND         _O_APPEND\r
+#if defined(O_TEXT)\r
+# define QT_OPEN_TEXT          _O_TEXT\r
+# define QT_OPEN_BINARY                _O_BINARY\r
+#endif\r
+\r
+#define QT_FOPEN                ::fopen\r
+#ifdef QT_LARGEFILE_SUPPORT\r
+#define QT_FSEEK                ::fseeko64\r
+#define QT_FTELL                ::ftello64\r
+#else\r
+#define QT_FSEEK                ::fseek\r
+#define QT_FTELL                ::ftell\r
+#endif\r
+#define QT_FGETPOS              ::fgetpos\r
+#define QT_FSETPOS              ::fsetpos\r
+#define QT_FPOS_T               fpos_t\r
+#ifdef QT_LARGEFILE_SUPPORT\r
+#define QT_OFF_T                off64_t\r
+#else\r
+#define QT_OFF_T                long\r
+#endif\r
+\r
+#define QT_SIGNAL_ARGS         int\r
+\r
+#define QT_VSNPRINTF           ::_vsnprintf\r
+#define QT_SNPRINTF            ::_snprintf\r
+\r
+# define F_OK  0\r
+# define X_OK  1\r
+# define W_OK  2\r
+# define R_OK  4\r
+\r
+\r
+#endif // QPLATFORMDEFS_H\r