so much for the code changes required to compile on mingw.

SVN revision: 10832
This commit is contained in:
tsauerbeck 2004-07-14 16:37:29 +00:00 committed by tsauerbeck
parent 538432bc95
commit 8bc99227a1
4 changed files with 26 additions and 5 deletions

View File

@ -21,12 +21,13 @@ AM_PROG_LIBTOOL
AC_CHECK_HEADER(zlib.h,, AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
AC_CHECK_HEADER(jpeglib.h,, AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
AC_CHECK_HEADERS(netinet/in.h)
dnl These are needed for fmemopen/open_memstream
AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
AC_DEFINE(__USE_GNU, , [Enable GNU extensions])
AC_CHECK_FUNCS(fmemopen)
AC_CHECK_FUNCS(open_memstream)
AC_CHECK_FUNCS(fmemopen open_memstream realpath)
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then

View File

@ -161,13 +161,18 @@ void pak_file(Eet_File *ef, char *file, char **noz, int noz_num);
void pak_dir(Eet_File *ef, char *dir, char **noz, int noz_num);
void pack(char *pak_file, char **files, int count, char **noz, int noz_num);
static mode_t default_mode =
S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
int
eet_mkdir(char *dir)
{
#ifdef __MINGW32__
if (mkdir(dir) < 0) return 0;
#else
mode_t default_mode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP
| S_IROTH | S_IXOTH;
if (mkdir(dir, default_mode) < 0) return 0;
#endif
return 1;
}

View File

@ -1,7 +1,9 @@
#ifndef _EET_PRIVATE_H
#define _EET_PRIVATE_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <unistd.h>
@ -9,8 +11,15 @@
#include <stdlib.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#elif __MINGW32__
#include <winsock.h>
#endif
#include <zlib.h>
#include <string.h>
#include <fnmatch.h>

View File

@ -310,11 +310,17 @@ eet_open(char *file, Eet_File_Mode mode)
char buf[PATH_MAX];
if (!file) return NULL;
#ifdef HAVE_REALPATH
/* in case this is a symlink... find out where it REALLY points */
if (!realpath(file, buf))
{
if (mode == EET_FILE_MODE_READ) return NULL;
}
#else
strncpy(buf, file, sizeof(buf));
buf[sizeof(buf) - 1] = 0;
#endif
/* find the current file handle in cache*/
ef = NULL;