Change in an attempt to fix compilation on mingw.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1059 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2003-07-17 22:42:59 +00:00
parent 2a62981df3
commit d86b2da125
+12 -10
View File
@@ -36,28 +36,30 @@ typedef short gid_t;
/* PATH_MAX is per POSIX defined in <limits.h> */ /* PATH_MAX is per POSIX defined in <limits.h> */
# define inline __inline__ # define inline __inline__
#endif #endif
#ifdef _MSC_VER #ifdef WIN32
# include <io.h> # include <io.h>
#define mkdir MS_INSANE_MKDIR # define mkdir MS_INSANE_MKDIR
// direct.h would give a bad definition of mkdir(). Now it gives // direct.h would give a bad definition of mkdir(). Now it gives
// a bad definition of MS_INSANE_MKDIR(), which we won't use. // a bad definition of MS_INSANE_MKDIR(), which we won't use.
// Yes, it's a hack, but this way the hack will stay local to // Yes, it's a hack, but this way the hack will stay local to
// the MS-specific stuff. // the MS-specific stuff.
# include <direct.h> # include <direct.h>
#undef mkdir # undef mkdir
# include <sys/stat.h>
typedef int ssize_t;
typedef unsigned short mode_t; typedef unsigned short mode_t;
# define access _access
# define F_OK 0
# define W_OK 2
# define R_OK 4
# define open _open
static inline int static inline int
mkdir(const char *pathname, mode_t mode) { mkdir(const char *pathname, mode_t mode) {
(void) mode; (void) mode;
return _mkdir(pathname); return _mkdir(pathname);
} }
#endif /* WIN32 */
#ifdef _MSC_VER
# include <sys/stat.h>
typedef int ssize_t;
# define access _access
# define F_OK 0
# define W_OK 2
# define R_OK 4
# define open _open
# define read _read # define read _read
# define rmdir _rmdir # define rmdir _rmdir
# define lseek _lseek # define lseek _lseek