so much for the code changes required to compile on mingw.
authortsauerbeck <tsauerbeck>
Wed, 14 Jul 2004 16:37:29 +0000 (16:37 +0000)
committertsauerbeck <tsauerbeck@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 14 Jul 2004 16:37:29 +0000 (16:37 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/e17/libs/eet@10832 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.in
src/bin/eet_main.c
src/lib/Eet_private.h
src/lib/eet_lib.c

index 6685d3c..a3eeb13 100644 (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
index c8690f6..3390ab8 100644 (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;
 }
 
index 69a5eaf..81c64d1 100644 (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>
index ecf689f..0c3eb10 100644 (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;