mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
Dynamically load Dr.Mingw
This improves compatibility with older systems, notably 32bit WinXP.
This commit is contained in:
parent
9ff3dc8251
commit
caf55e105e
3 changed files with 23 additions and 10 deletions
|
|
@ -74,10 +74,6 @@
|
||||||
#include <shellapi.h> // console
|
#include <shellapi.h> // console
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_DRMINGW
|
|
||||||
#include <exchndl.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WAF_BUILD
|
#ifdef WAF_BUILD
|
||||||
#include "gtk2ardour-version.h"
|
#include "gtk2ardour-version.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -342,7 +338,12 @@ int main (int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_DRMINGW
|
#ifdef HAVE_DRMINGW
|
||||||
if (true) {
|
/* prevent missing libs popups */
|
||||||
|
UINT prev_error_mode = SetErrorMode (SEM_FAILCRITICALERRORS);
|
||||||
|
SetErrorMode (prev_error_mode | SEM_FAILCRITICALERRORS);
|
||||||
|
HMODULE exchndl = LoadLibraryA ("exchndl.dll");
|
||||||
|
|
||||||
|
if (exchndl) {
|
||||||
/* %localappdata%\Ardour<X>\CrashLog\ */
|
/* %localappdata%\Ardour<X>\CrashLog\ */
|
||||||
string crash_dir = Glib::build_filename (Glib::get_user_data_dir (), string_compose ("%1%2", PROGRAM_NAME, PROGRAM_VERSION), "CrashLog");
|
string crash_dir = Glib::build_filename (Glib::get_user_data_dir (), string_compose ("%1%2", PROGRAM_NAME, PROGRAM_VERSION), "CrashLog");
|
||||||
g_mkdir_with_parents (crash_dir.c_str(), 0700);
|
g_mkdir_with_parents (crash_dir.c_str(), 0700);
|
||||||
|
|
@ -351,10 +352,23 @@ int main (int argc, char *argv[])
|
||||||
string crash_file = string_compose ("%1-%2-crash-%3.txt", PROGRAM_NAME, VERSIONSTRING, tm.format ("%s"));
|
string crash_file = string_compose ("%1-%2-crash-%3.txt", PROGRAM_NAME, VERSIONSTRING, tm.format ("%s"));
|
||||||
string crash_path = Glib::build_filename (crash_dir, crash_file);
|
string crash_path = Glib::build_filename (crash_dir, crash_file);
|
||||||
|
|
||||||
ExcHndlInit ();
|
typedef void (*exc_init_fn_t) (void);
|
||||||
ExcHndlSetLogFileNameA (crash_path.c_str());
|
typedef bool (*exc_path_fn_t) (const char *);
|
||||||
cout << "Crash Log: " << crash_path << endl;
|
|
||||||
|
exc_init_fn_t exchndl_init = (exc_init_fn_t) GetProcAddress (exchndl, "ExcHndlInit");
|
||||||
|
exc_path_fn_t exchndl_path = (exc_path_fn_t) GetProcAddress (exchndl, "ExcHndlSetLogFileNameA");
|
||||||
|
|
||||||
|
if (exchndl_init && exchndl_path) {
|
||||||
|
exchndl_init ();
|
||||||
|
exchndl_path (crash_path.c_str());
|
||||||
|
cout << "Crash Log: " << crash_path << endl;
|
||||||
|
} else {
|
||||||
|
cout << "Cannot initialize crash reporter" << endl;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cout << "Crash reporter is not compatible with this system" << endl;
|
||||||
}
|
}
|
||||||
|
SetErrorMode (prev_error_mode);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!ARDOUR::init (ARDOUR_COMMAND_LINE::use_vst, ARDOUR_COMMAND_LINE::try_hw_optimization, localedir.c_str(), true)) {
|
if (!ARDOUR::init (ARDOUR_COMMAND_LINE::use_vst, ARDOUR_COMMAND_LINE::try_hw_optimization, localedir.c_str(), true)) {
|
||||||
|
|
|
||||||
|
|
@ -678,7 +678,6 @@ def build(bld):
|
||||||
elif bld.env['build_target'] == 'mingw':
|
elif bld.env['build_target'] == 'mingw':
|
||||||
obj.source += [ 'bundle_env_mingw.cc' ]
|
obj.source += [ 'bundle_env_mingw.cc' ]
|
||||||
obj.source += [ 'windows_icon.rc' ]
|
obj.source += [ 'windows_icon.rc' ]
|
||||||
obj.uselib += ' DRMINGW '
|
|
||||||
else:
|
else:
|
||||||
obj.source += [ 'bundle_env_linux.cc' ]
|
obj.source += [ 'bundle_env_linux.cc' ]
|
||||||
|
|
||||||
|
|
|
||||||
2
wscript
2
wscript
|
|
@ -816,7 +816,7 @@ def options(opt):
|
||||||
help='Specify the target for cross-compiling [auto,none,x86,i386,i686,x86_64,tiger,leopard,mingw,msvc]')
|
help='Specify the target for cross-compiling [auto,none,x86,i386,i686,x86_64,tiger,leopard,mingw,msvc]')
|
||||||
opt.add_option('--dr-mingw', action='store_true', default=True, dest='drmingw',
|
opt.add_option('--dr-mingw', action='store_true', default=True, dest='drmingw',
|
||||||
help='Write crashdumps using Dr.Mingw (Windows Only)')
|
help='Write crashdumps using Dr.Mingw (Windows Only)')
|
||||||
opt.add_option('--no-dr-mingw', action='store_true', dest='drmingw')
|
opt.add_option('--no-dr-mingw', action='store_false', dest='drmingw')
|
||||||
opt.add_option('--fpu-optimization', action='store_true', default=True, dest='fpu_optimization',
|
opt.add_option('--fpu-optimization', action='store_true', default=True, dest='fpu_optimization',
|
||||||
help='Build runtime checked assembler code (default)')
|
help='Build runtime checked assembler code (default)')
|
||||||
opt.add_option('--no-fpu-optimization', action='store_false', dest='fpu_optimization')
|
opt.add_option('--no-fpu-optimization', action='store_false', dest='fpu_optimization')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue