Skip to content

Commit af11901

Browse files
committed
Fix win32 build
Signed-off-by: falkTX <falktx@falktx.com>
1 parent 2bd134c commit af11901

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/effects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ static char* _strchrnul(const char *s, int c)
10191019

10201020
#ifdef _WIN32
10211021
// missing on Windows
1022-
static char* realpath(const char *name, char *resolved)
1022+
static char* _realpath(const char *name, char *resolved)
10231023
{
10241024
if (name == NULL)
10251025
return NULL;

src/mod-host.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,18 @@ static void term_signal(int sig)
10031003
return; (void)sig;
10041004
}
10051005

1006+
#ifdef _WIN32
1007+
static BOOL WINAPI win32_signal(DWORD type)
1008+
{
1009+
if (type == CTRL_C_EVENT)
1010+
{
1011+
term_signal(0);
1012+
return TRUE;
1013+
}
1014+
return FALSE;
1015+
}
1016+
#endif
1017+
10061018
static int mod_host_init(jack_client_t* client, int socket_port, int feedback_port)
10071019
{
10081020
#ifdef HAVE_FFTW335
@@ -1266,6 +1278,7 @@ int main(int argc, char **argv)
12661278
#endif
12671279
{
12681280
#ifdef _WIN32
1281+
SetConsoleCtrlHandler(win32_signal, TRUE);
12691282
#else
12701283
struct sigaction sig;
12711284
memset(&sig, 0, sizeof(sig));

0 commit comments

Comments
 (0)