diff --git a/legacy/eet/configure.in b/legacy/eet/configure.in index 6685d3c10d..a3eeb13c2d 100644 --- a/legacy/eet/configure.in +++ b/legacy/eet/configure.in @@ -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 diff --git a/legacy/eet/src/bin/eet_main.c b/legacy/eet/src/bin/eet_main.c index c8690f6b73..3390ab8bd4 100644 --- a/legacy/eet/src/bin/eet_main.c +++ b/legacy/eet/src/bin/eet_main.c @@ -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; } diff --git a/legacy/eet/src/lib/Eet_private.h b/legacy/eet/src/lib/Eet_private.h index 69a5eaf196..81c64d14c5 100644 --- a/legacy/eet/src/lib/Eet_private.h +++ b/legacy/eet/src/lib/Eet_private.h @@ -1,7 +1,9 @@ #ifndef _EET_PRIVATE_H #define _EET_PRIVATE_H +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include #include @@ -9,8 +11,15 @@ #include #include #include +#include #include + +#ifdef HAVE_NETINET_IN_H #include +#elif __MINGW32__ +#include +#endif + #include #include #include diff --git a/legacy/eet/src/lib/eet_lib.c b/legacy/eet/src/lib/eet_lib.c index ecf689f823..0c3eb10f4f 100644 --- a/legacy/eet/src/lib/eet_lib.c +++ b/legacy/eet/src/lib/eet_lib.c @@ -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;