/****************************************************************************
** $Id:
**
** Platform Definitions
**
** Copyright (C) 2002 Wolfpack Emu.  All rights reserved.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
**********************************************************************/

#if !defined (__QPLATFORMDEFS_H__)
#define __QPLATFORMDEFS_H__

#include "qglobal.h"

// System Includes
#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <direct.h>
#include <windows.h>

#define _POSIX_
#include <limits.h>
#undef _POSIX_

// Platform Specific defines

#define QT_OPEN		::_open
#define QT_CLOSE	::_close
#define QT_READ		::_read
#define QT_WRITE	::_write
#define QT_ACCESS	::_access
#define QT_FSTAT	::_fstat
#define QT_STAT		::_stat
#define QT_LSEEK	::_lseek
#define QT_GETCWD	::_getcwd
#define QT_CHDIR	::_chdir
#define QT_MKDIR	::_mkdir
#define QT_RMDIR	::_rmdir
#define QT_STATBUF	struct _stat
#define QT_SOCKLEN_T int FAR

#define QT_VSNPRINTF ::_vsnprintf

#define QT_STAT_MASK		_S_IFMT
#define QT_STAT_REG			_S_IFREG
# define QT_STAT_DIR		_S_IFDIR

#define QT_FILENO			_fileno
#define QT_OPEN_RDONLY		_O_RDONLY
#define QT_OPEN_WRONLY		_O_WRONLY
#define QT_OPEN_RDWR		_O_RDWR
#define QT_OPEN_CREAT		_O_CREAT
#define QT_OPEN_TRUNC		_O_TRUNC
#define QT_OPEN_APPEND		_O_APPEND

# define F_OK	0
# define X_OK	1
# define W_OK	2
# define R_OK	4

// Argh Windows data types
typedef void* HANDLE;
//typedef void* HINSTANCE;

#endif // __QPLATFORMDEFS_H__