| 1 |
// ____ _ __ |
| 2 |
// / __ )____ _____ | | / /___ ___________ |
| 3 |
// / __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/ |
| 4 |
// / /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ ) |
| 5 |
// /_____/\____/____/ |__/|__/\__,_/_/ /____/ |
| 6 |
// |
| 7 |
// A futuristic real-time strategy game. |
| 8 |
// This file is part of Bos Wars. |
| 9 |
// |
| 10 |
/**@name iocompat.h - IO platform compatibility header file. */ |
| 11 |
// |
| 12 |
// (c) Copyright 2002-2007 by Andreas Arens |
| 13 |
// |
| 14 |
// This program is free software; you can redistribute it and/or modify |
| 15 |
// it under the terms of the GNU General Public License as published by |
| 16 |
// the Free Software Foundation; only version 2 of the License. |
| 17 |
// |
| 18 |
// This program is distributed in the hope that it will be useful, |
| 19 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 |
// GNU General Public License for more details. |
| 22 |
// |
| 23 |
// You should have received a copy of the GNU General Public License |
| 24 |
// along with this program; if not, write to the Free Software |
| 25 |
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 26 |
// 02111-1307, USA. |
| 27 |
|
| 28 |
#ifndef __IOCOMPAT_H__ |
| 29 |
#define __IOCOMPAT_H__ |
| 30 |
|
| 31 |
//@{ |
| 32 |
|
| 33 |
/*---------------------------------------------------------------------------- |
| 34 |
-- Platform dependant IO-related Includes and Definitions |
| 35 |
----------------------------------------------------------------------------*/ |
| 36 |
|
| 37 |
#ifndef _MSC_VER |
| 38 |
|
| 39 |
#include <sys/types.h> |
| 40 |
#include <sys/stat.h> |
| 41 |
#include <dirent.h> |
| 42 |
#include <string.h> |
| 43 |
#include <unistd.h> |
| 44 |
#include <limits.h> |
| 45 |
#include <errno.h> |
| 46 |
|
| 47 |
#else // _MSC_VER |
| 48 |
|
| 49 |
#define R_OK 4 |
| 50 |
#define F_OK 0 |
| 51 |
#include <sys/types.h> |
| 52 |
#include <sys/stat.h> |
| 53 |
#include <direct.h> |
| 54 |
#include <string.h> |
| 55 |
#include <stdlib.h> |
| 56 |
#include <errno.h> |
| 57 |
#include <io.h> |
| 58 |
#include <fcntl.h> |
| 59 |
#define PATH_MAX _MAX_PATH |
| 60 |
#define S_ISDIR(x) ((x) & _S_IFDIR) |
| 61 |
#define S_ISREG(x) ((x) & _S_IFREG) |
| 62 |
|
| 63 |
#endif // _MSC_VER |
| 64 |
|
| 65 |
#ifndef O_BINARY |
| 66 |
#define O_BINARY 0 |
| 67 |
#endif |
| 68 |
|
| 69 |
//@} |
| 70 |
|
| 71 |
#endif // !__IOCOMPAT_H__ |