_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

iocompat.h
Go to the documentation of this file.
1 // _________ __ __
2 // / _____// |_____________ _/ |______ ____ __ __ ______
3 // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
4 // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
5 // /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
6 // \/ \/ \//_____/ \/
7 // ______________________ ______________________
8 // T H E W A R B E G I N S
9 // Stratagus - A free fantasy real time strategy game engine
10 //
12 //
13 // (c) Copyright 2002-2005 by Andreas Arens
14 //
15 // This program is free software; you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation; only version 2 of the License.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 // 02111-1307, USA.
28 //
29 
30 #ifndef __IOCOMPAT_H__
31 #define __IOCOMPAT_H__
32 
34 
35 /*----------------------------------------------------------------------------
36 -- Platform dependent IO-related Includes and Definitions
37 ----------------------------------------------------------------------------*/
38 
39 #include <sys/types.h>
40 #include <sys/stat.h>
41 #include <string.h>
42 #include <stdlib.h>
43 #include <limits.h>
44 #include <errno.h>
45 
46 #ifdef _MSC_VER
47 
48 #include <io.h>
49 #include <fcntl.h>
50 #include <direct.h>
51 
52 #define R_OK 4
53 #define F_OK 0
54 #define PATH_MAX _MAX_PATH
55 #define S_ISDIR(x) ((x) & _S_IFDIR)
56 #define S_ISREG(x) ((x) & _S_IFREG)
57 
58 #define mkdir _mkdir
59 #define access _access
60 
61 #else
62 
63 #include <unistd.h>
64 #include <dirent.h>
65 
66 #endif
67 
68 #ifndef O_BINARY
69 #define O_BINARY 0
70 #endif
71 
72 #ifdef USE_WIN32
73 #define makedir(dir, permissions) mkdir(dir)
74 #else
75 #define makedir(dir, permissions) mkdir(dir, permissions)
76 #endif
77 
79 
80 #endif // !__IOCOMPAT_H__
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.