Currently, mingw-w64 has its own implementation of relocable widl support. With new Wine helpers, it may use Wine support instead and reduce the diff. This MR brings `get_bindir` in pair with mingw-w64's counterpart.
From: Jacek Caban jacek@codeweavers.com
--- tools/tools.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/tools.h b/tools/tools.h index 39441cb0ea6..69c976df0bf 100644 --- a/tools/tools.h +++ b/tools/tools.h @@ -56,6 +56,8 @@ # define strncasecmp _strnicmp # define strcasecmp _stricmp # endif +# include <windef.h> +# include <winbase.h> #else extern char **environ; # include <spawn.h> @@ -706,7 +708,10 @@ static inline char *get_bindir( const char *argv0 ) if (!dir && !(dir = realpath( argv0, NULL ))) return NULL; return get_dirname( dir ); #else - return get_dirname( argv0 ); + char path[MAX_PATH], *p; + GetModuleFileNameA( NULL, path, ARRAYSIZE(path) ); + for (p = path; *p; p++) if (*p == '\') *p = '/'; + return get_dirname( path ); #endif }
From: Jacek Caban jacek@codeweavers.com
--- tools/tools.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/tools.h b/tools/tools.h index 69c976df0bf..b840a85b2e5 100644 --- a/tools/tools.h +++ b/tools/tools.h @@ -695,7 +695,8 @@ static inline char *get_bindir( const char *argv0 ) #ifndef _WIN32 char *dir = NULL;
-#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) +#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) \ + || defined(__CYGWIN__) || defined(__MSYS__) dir = realpath( "/proc/self/exe", NULL ); #elif defined (__FreeBSD__) || defined(__DragonFly__) static int pathname[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };