Skip to content

Commit

Permalink
wine related fixes
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Feb 28, 2024
1 parent 1f6bcd0 commit 776c936
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
9 changes: 8 additions & 1 deletion source/bridges-plugin/CarlaBridgePlugin.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Carla Bridge Plugin
* Copyright (C) 2012-2023 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions source/discovery/carla-discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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

// ----------------------------------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions source/jackbridge/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 776c936

Please sign in to comment.