External, Non-PPA KXStudio Repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
3.3KB

  1. commit 85beab57e1616f1b5bc923319d7abbbcc86ceea2
  2. Author: falkTX <falktx@falktx.com>
  3. Date: Wed Feb 28 22:16:15 2024 +0100
  4. wine related fixes
  5. Signed-off-by: falkTX <falktx@falktx.com>
  6. diff --git a/source/bridges-plugin/CarlaBridgePlugin.cpp b/source/bridges-plugin/CarlaBridgePlugin.cpp
  7. index cbf79ebf1..991cf4257 100644
  8. --- a/source/bridges-plugin/CarlaBridgePlugin.cpp
  9. +++ b/source/bridges-plugin/CarlaBridgePlugin.cpp
  10. @@ -86,6 +86,11 @@ static void saveSignalHandler(int) noexcept
  11. gSaveNow = true;
  12. }
  13. #elif defined(CARLA_OS_WIN)
  14. +static LONG WINAPI winExceptionFilter(_EXCEPTION_POINTERS*)
  15. +{
  16. + return EXCEPTION_EXECUTE_HANDLER;
  17. +}
  18. +
  19. static BOOL WINAPI winSignalHandler(DWORD dwCtrlType) noexcept
  20. {
  21. if (dwCtrlType == CTRL_C_EVENT)
  22. @@ -115,6 +120,8 @@ static void initSignalHandler()
  23. sigaction(SIGUSR1, &sig, nullptr);
  24. #elif defined(CARLA_OS_WIN)
  25. SetConsoleCtrlHandler(winSignalHandler, TRUE);
  26. + SetErrorMode(SEM_NOGPFAULTERRORBOX);
  27. + SetUnhandledExceptionFilter(winExceptionFilter);
  28. #endif
  29. }
  30. diff --git a/source/discovery/carla-discovery.cpp b/source/discovery/carla-discovery.cpp
  31. index 43a3af0d7..996c33247 100644
  32. --- a/source/discovery/carla-discovery.cpp
  33. +++ b/source/discovery/carla-discovery.cpp
  34. @@ -132,7 +132,6 @@ protected:
  35. CarlaScopedPointer<DiscoveryPipe> gPipe;
  36. -
  37. // --------------------------------------------------------------------------------------------------------------------
  38. // Don't print ELF/EXE related errors since discovery can find multi-architecture binaries
  39. @@ -151,6 +150,16 @@ static void print_lib_error(const char* const filename)
  40. }
  41. }
  42. +#ifdef CARLA_OS_WIN
  43. +// --------------------------------------------------------------------------------------------------------------------
  44. +// Do not show error message box on Windows
  45. +
  46. +static LONG WINAPI winExceptionFilter(_EXCEPTION_POINTERS*)
  47. +{
  48. + return EXCEPTION_EXECUTE_HANDLER;
  49. +}
  50. +#endif
  51. +
  52. // --------------------------------------------------------------------------------------------------------------------
  53. // Plugin Checks
  54. @@ -2305,13 +2314,19 @@ int main(int argc, const char* argv[])
  55. #endif
  56. #ifdef CARLA_OS_WIN
  57. + // init win32 stuff that plugins might use
  58. OleInitialize(nullptr);
  59. CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
  60. +
  61. # ifndef __WINPTHREADS_VERSION
  62. // (non-portable) initialization of statically linked pthread library
  63. pthread_win32_process_attach_np();
  64. pthread_win32_thread_attach_np();
  65. # endif
  66. +
  67. + // do not show error message box on Windows
  68. + SetErrorMode(SEM_NOGPFAULTERRORBOX);
  69. + SetUnhandledExceptionFilter(winExceptionFilter);
  70. #endif
  71. // ---------------------------------------------------------------------------------------------------------------
  72. diff --git a/source/jackbridge/Makefile b/source/jackbridge/Makefile
  73. index a7bd0a4cf..a95776ef8 100644
  74. --- a/source/jackbridge/Makefile
  75. +++ b/source/jackbridge/Makefile
  76. @@ -22,6 +22,7 @@ WINE_32BIT_FLAGS = $(32BIT_FLAGS) -fpermissive
  77. WINE_64BIT_FLAGS = $(64BIT_FLAGS) -fpermissive
  78. WINE_BUILD_FLAGS = $(filter-out -flto,$(BUILD_CXX_FLAGS))
  79. WINE_LINK_FLAGS = $(filter-out -flto -static-libgcc -static-libstdc++,$(LINK_FLAGS))
  80. +WINE_LINK_FLAGS += -nostartfiles
  81. WINE_LINK_FLAGS += $(LIBDL_LIBS)
  82. WINE_LINK_FLAGS += -pthread
  83. WINE_LINK_FLAGS += -lstdc++