From 776c936829c346854ef9569d39bf986ae6a0fadc Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 28 Feb 2024 22:08:16 +0100 Subject: [PATCH] wine related fixes Signed-off-by: falkTX --- source/bridges-plugin/CarlaBridgePlugin.cpp | 9 ++++++++- source/discovery/carla-discovery.cpp | 4 ++-- source/jackbridge/Makefile | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/source/bridges-plugin/CarlaBridgePlugin.cpp b/source/bridges-plugin/CarlaBridgePlugin.cpp index abc9b35d1..843e11883 100644 --- a/source/bridges-plugin/CarlaBridgePlugin.cpp +++ b/source/bridges-plugin/CarlaBridgePlugin.cpp @@ -1,6 +1,6 @@ /* * Carla Bridge Plugin - * Copyright (C) 2012-2023 Filipe Coelho + * Copyright (C) 2012-2024 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -84,6 +84,11 @@ static void saveSignalHandler(int) noexcept gSaveNow = true; } #elif defined(CARLA_OS_WIN) +static LONG WINAPI winExceptionFilter(_EXCEPTION_POINTERS*) +{ + return EXCEPTION_EXECUTE_HANDLER; +} + static BOOL WINAPI winSignalHandler(DWORD dwCtrlType) noexcept { if (dwCtrlType == CTRL_C_EVENT) @@ -113,6 +118,8 @@ static void initSignalHandler() sigaction(SIGUSR1, &sig, nullptr); #elif defined(CARLA_OS_WIN) SetConsoleCtrlHandler(winSignalHandler, TRUE); + SetErrorMode(SEM_NOGPFAULTERRORBOX); + SetUnhandledExceptionFilter(winExceptionFilter); #endif } diff --git a/source/discovery/carla-discovery.cpp b/source/discovery/carla-discovery.cpp index c038cb9d9..31bf0351d 100644 --- a/source/discovery/carla-discovery.cpp +++ b/source/discovery/carla-discovery.cpp @@ -176,7 +176,7 @@ static void print_lib_error(const char* const filename) // -------------------------------------------------------------------------------------------------------------------- // Do not show error message box on Windows -static LONG win32ExceptionFilter(_EXCEPTION_POINTERS*) +static LONG WINAPI winExceptionFilter(_EXCEPTION_POINTERS*) { return EXCEPTION_EXECUTE_HANDLER; } @@ -2827,7 +2827,7 @@ int main(int argc, const char* argv[]) // do not show error message box on Windows SetErrorMode(SEM_NOGPFAULTERRORBOX); - SetUnhandledExceptionFilter(win32ExceptionFilter); + SetUnhandledExceptionFilter(winExceptionFilter); #endif // ---------------------------------------------------------------------------------------------------------------- diff --git a/source/jackbridge/Makefile b/source/jackbridge/Makefile index 69a30ac0e..2294e2581 100644 --- a/source/jackbridge/Makefile +++ b/source/jackbridge/Makefile @@ -28,6 +28,7 @@ WINE_32BIT_FLAGS = $(32BIT_FLAGS) -fpermissive WINE_64BIT_FLAGS = $(64BIT_FLAGS) -fpermissive WINE_BUILD_FLAGS = $(filter-out -flto,$(BUILD_CXX_FLAGS)) WINE_LINK_FLAGS = $(filter-out -flto -static-libgcc -static-libstdc++,$(LINK_FLAGS)) +WINE_LINK_FLAGS += -nostartfiles WINE_LINK_FLAGS += $(LIBDL_LIBS) WINE_LINK_FLAGS += -pthread WINE_LINK_FLAGS += -lpthread