diff --git a/ChangeLog b/ChangeLog index 201450ca7..136e9c71e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2013-08-10 Ivan Vucica + + * Source/NSPathUtilities.m: + Disabled check for secure temporary directories under Cygwin. Refer + to: + http://stackoverflow.com/q/9561759/39974 + for a possible cause of problems. + + * Source/objc-load.m: + Codepaths used for MinGW are now also used for Cygwin. Even in + case of some functionality that should be standard under UNIX systems, + it turns out that this functionality is, sadly, not present under + Cygwin (e.g. dladdr()). + 2013-08-10 Lubos Dolezel * Source/NSBundle.m: add NSBundle bundleURL, builtInPlugInsURL, diff --git a/Source/NSPathUtilities.m b/Source/NSPathUtilities.m index 3eda6c41a..baa7fabcb 100644 --- a/Source/NSPathUtilities.m +++ b/Source/NSPathUtilities.m @@ -1942,6 +1942,7 @@ NSTemporaryDirectory(void) if (baseTempDirName == nil) { #if defined(__CYGWIN__) +#warning Basing temporary directory in /cygdrive/c; any reason? baseTempDirName = @"/cygdrive/c/"; #elif defined(__MINGW__) baseTempDirName = @"C:\\"; @@ -1982,7 +1983,9 @@ NSTemporaryDirectory(void) perm = perm & 0777; // Mateu Batle: secure temporary directories don't work in MinGW -#ifndef __MINGW__ +// Ivan Vucica: there are also problems with Cygwin +// probable cause: http://stackoverflow.com/q/9561759/39974 +#if !defined(__MINGW__) && !defined(__CYGWIN__) #if defined(__MINGW__) uid = owner; diff --git a/Source/objc-load.m b/Source/objc-load.m index 99de92e74..906a756d2 100644 --- a/Source/objc-load.m +++ b/Source/objc-load.m @@ -35,6 +35,10 @@ # include #endif +#if defined(__CYGWIN__) +# include +#endif + #include "objc-load.h" #import "Foundation/NSException.h" @@ -83,7 +87,7 @@ static int objc_initialize_loading(FILE *errorStream) { NSString *path; -#ifdef __MINGW__ +#if defined(__MINGW__) || defined(__CYGWIN__) const unichar *fsPath; #else const char *fsPath; @@ -126,7 +130,7 @@ objc_load_callback(Class class, struct objc_category * category) } } -#if defined(__MINGW__) +#if defined(__MINGW__) || defined(__CYGWIN__) #define FSCHAR unichar #else #define FSCHAR char @@ -237,7 +241,7 @@ GSPrivateUnloadModule(FILE *errorStream, } -#ifdef __MINGW__ +#if defined(__MINGW__) || defined(__CYGWIN__) // FIXME: We can probably get rid of this now - MinGW should include a working // dladdr() wrapping this function, so we no longer need a Windows-only code // path @@ -252,6 +256,9 @@ GSPrivateSymbolPath(Class theClass, Category *theCategory) VirtualQueryEx(GetCurrentProcess(), theClass, &memInfo, sizeof(memInfo)); if (GetModuleFileNameW(memInfo.AllocationBase, buf, sizeof(buf))) { +#ifdef __CYGWIN__ +#warning Under Cygwin, we may want to use cygwin_conv_path() to get the unix path back? +#endif s = [NSString stringWithCharacters: buf length: wcslen(buf)]; } return s;