diff options
-rw-r--r-- | sal/Library_sal.mk | 5 | ||||
-rw-r--r-- | sal/osl/unx/system.cxx | 13 | ||||
-rw-r--r-- | sal/osl/unx/system.mm | 1 |
3 files changed, 17 insertions, 2 deletions
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index 17d89ae79e4a..b0921dd8ff24 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -178,21 +178,22 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ sal/osl/unx/security \ sal/osl/unx/signal \ sal/osl/unx/socket \ - sal/osl/unx/system \ sal/osl/unx/tempfile \ sal/osl/unx/thread \ sal/osl/unx/time \ $(if $(filter-out ANDROID IOS,$(OS)), sal/osl/unx/salinit) \ )) -# Note that the uunxapi.mm file just includes the uunxapi.cxx one +# Note that the uunxapi.mm file just includes the uunxapi.cxx one. Ditto for system.mm ifeq ($(OS),MACOSX) $(eval $(call gb_Library_add_objcxxobjects,sal,\ sal/osl/unx/uunxapi \ + sal/osl/unx/system \ )) else $(eval $(call gb_Library_add_exception_objects,sal,\ sal/osl/unx/uunxapi \ + sal/osl/unx/system \ )) endif diff --git a/sal/osl/unx/system.cxx b/sal/osl/unx/system.cxx index 7003b4ff5a41..9b7f05d93b28 100644 --- a/sal/osl/unx/system.cxx +++ b/sal/osl/unx/system.cxx @@ -37,6 +37,10 @@ #define RTL_MUTEX_LOCK #define RTL_MUTEX_UNLOCK +#include <premac.h> +#include <Foundation/Foundation.h> +#include <postmac.h> + #else //defined(MACOSX) static pthread_mutex_t getrtl_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -162,6 +166,15 @@ int macxp_resolveAlias(char *path, int buflen) CFErrorRef cferror; CFDataRef cfbookmark; + // Don't even try anything for files inside the app bundle. Just a + // waste of time. + + static const char * const appBundle = [[[NSBundle mainBundle] bundlePath] UTF8String]; + + const size_t appBundleLen = strlen(appBundle); + if (strncmp(path, appBundle, appBundleLen) == 0 && path[appBundleLen] == '/') + return 0; + char *unprocessedPath = path; if ( *unprocessedPath == '/' ) diff --git a/sal/osl/unx/system.mm b/sal/osl/unx/system.mm new file mode 100644 index 000000000000..7495a3e73058 --- /dev/null +++ b/sal/osl/unx/system.mm @@ -0,0 +1 @@ +#include "system.cxx" |