forked from enlightenment/efl
so much for the code changes required to compile on mingw.
SVN revision: 10832
This commit is contained in:
parent
538432bc95
commit
8bc99227a1
|
@ -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(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_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
|
dnl These are needed for fmemopen/open_memstream
|
||||||
AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
|
AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
|
||||||
AC_DEFINE(__USE_GNU, , [Enable GNU extensions])
|
AC_DEFINE(__USE_GNU, , [Enable GNU extensions])
|
||||||
|
|
||||||
AC_CHECK_FUNCS(fmemopen)
|
AC_CHECK_FUNCS(fmemopen open_memstream realpath)
|
||||||
AC_CHECK_FUNCS(open_memstream)
|
|
||||||
|
|
||||||
if test "x${exec_prefix}" = "xNONE"; then
|
if test "x${exec_prefix}" = "xNONE"; then
|
||||||
if test "x${prefix}" = "xNONE"; then
|
if test "x${prefix}" = "xNONE"; then
|
||||||
|
|
|
@ -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 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);
|
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
|
int
|
||||||
eet_mkdir(char *dir)
|
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;
|
if (mkdir(dir, default_mode) < 0) return 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
#ifndef _EET_PRIVATE_H
|
#ifndef _EET_PRIVATE_H
|
||||||
#define _EET_PRIVATE_H
|
#define _EET_PRIVATE_H
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -9,8 +11,15 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#elif __MINGW32__
|
||||||
|
#include <winsock.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <fnmatch.h>
|
#include <fnmatch.h>
|
||||||
|
|
|
@ -310,11 +310,17 @@ eet_open(char *file, Eet_File_Mode mode)
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
|
|
||||||
if (!file) return NULL;
|
if (!file) return NULL;
|
||||||
|
|
||||||
|
#ifdef HAVE_REALPATH
|
||||||
/* in case this is a symlink... find out where it REALLY points */
|
/* in case this is a symlink... find out where it REALLY points */
|
||||||
if (!realpath(file, buf))
|
if (!realpath(file, buf))
|
||||||
{
|
{
|
||||||
if (mode == EET_FILE_MODE_READ) return NULL;
|
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*/
|
/* find the current file handle in cache*/
|
||||||
ef = NULL;
|
ef = NULL;
|
||||||
|
|
Loading…
Reference in New Issue