From: Brendan Shanks bshanks@codeweavers.com
--- server/unicode.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/server/unicode.c b/server/unicode.c index b4864310f83..bb39b55e50c 100644 --- a/server/unicode.c +++ b/server/unicode.c @@ -29,6 +29,9 @@ #ifdef HAVE_SYS_SYSCTL_H # include <sys/sysctl.h> #endif +#ifdef __APPLE__ +# include <mach-o/dyld.h> +#endif
#include "windef.h" #include "winternl.h" @@ -290,6 +293,17 @@ static char *get_nls_dir(void) dir = NULL; } } +#elif defined(__APPLE__) + uint32_t dir_size = PATH_MAX; + dir = malloc( dir_size ); + if (dir) + { + if (_NSGetExecutablePath( dir, &dir_size )) + { + free( dir ); + dir = NULL; + } + } #else dir = realpath( server_argv0, NULL ); #endif