Enlightenment CVS committal Author : doursse Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_file Modified Files: ecore_file.c Log Message: Windows port: mkdir is obsolete with vc++, use _mkdir instead. Define macros for realpath and mkdir =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_file/ecore_file.c,v retrieving revision 1.70 retrieving revision 1.71 diff -u -3 -r1.70 -r1.71 --- ecore_file.c 9 Sep 2007 11:05:02 -0000 1.70 +++ ecore_file.c 21 Sep 2007 17:06:24 -0000 1.71 @@ -22,9 +22,10 @@ static int init = 0; -/* FIXME: Windows has no symbolic link. */ -/* Nevertheless, it can creates .lnk files */ #ifdef _WIN32 + +/* FIXME: Windows has no symbolic link. */ +/* Nevertheless, it can create and read .lnk files */ static int symlink(const char *oldpath, const char *newpath) { @@ -129,6 +130,11 @@ CoUninitialize(); return -1; } + +#define realpath(file_name, resolved_name) _fullpath((resolved_name), (file_name), PATH_MAX) + +#define mkdir(path, mode) _mkdir((path)) + #endif /* _WIN32 */ /* externally accessible functions */ @@ -248,11 +254,7 @@ EAPI int ecore_file_mkdir(const char *dir) { -#ifndef _WIN32 if (mkdir(dir, default_mode) < 0) return 0; -#else - if (mkdir(dir) < 0) return 0; -#endif /* _WIN32 */ return 1; } @@ -381,13 +383,8 @@ size_t num; int ret = 1; -#ifndef _WIN32 if (!realpath(src, realpath1)) return 0; if (realpath(dst, realpath2) && !strcmp(realpath1, realpath2)) return 0; -#else - if (!_fullpath(realpath1, src, _MAX_PATH)) return 0; - if (_fullpath(realpath2, dst, _MAX_PATH) && !strcmp(realpath1, realpath2)) return 0; -#endif /* _WIN32 */ f1 = fopen(src, "rb"); if (!f1) return 0; @@ -461,11 +458,7 @@ { char buf[PATH_MAX]; -#ifndef _WIN32 if (!realpath(file, buf)) return strdup(""); -#else - if (!_fullpath(buf, file, _MAX_PATH)) return strdup(""); -#endif /* _WIN32 */ return strdup(buf); } ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs