summaryrefslogtreecommitdiff
path: root/contrib/less/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/less/signal.c')
-rw-r--r--contrib/less/signal.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/contrib/less/signal.c b/contrib/less/signal.c
index b2736d274a8c..0f304efe986c 100644
--- a/contrib/less/signal.c
+++ b/contrib/less/signal.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2017 Mark Nudelman
+ * Copyright (C) 1984-2019 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -40,6 +40,7 @@ extern long jump_sline_fraction;
/*
* Interrupt signal handler.
*/
+#if MSDOS_COMPILER!=WIN32C
/* ARGSUSED*/
static RETSIGTYPE
u_interrupt(type)
@@ -65,6 +66,7 @@ u_interrupt(type)
if (reading)
intread(); /* May longjmp */
}
+#endif
#ifdef SIGTSTP
/*
@@ -111,7 +113,8 @@ winch(type)
/*
* Handle CTRL-C and CTRL-BREAK keys.
*/
-#include "windows.h"
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
static BOOL WINAPI
wbreak_handler(dwCtrlType)
@@ -149,9 +152,10 @@ init_signals(on)
/*
* Set signal handlers.
*/
- (void) LSIGNAL(SIGINT, u_interrupt);
#if MSDOS_COMPILER==WIN32C
SetConsoleCtrlHandler(wbreak_handler, TRUE);
+#else
+ (void) LSIGNAL(SIGINT, u_interrupt);
#endif
#ifdef SIGTSTP
(void) LSIGNAL(SIGTSTP, stop);
@@ -173,9 +177,10 @@ init_signals(on)
/*
* Restore signals to defaults.
*/
- (void) LSIGNAL(SIGINT, SIG_DFL);
#if MSDOS_COMPILER==WIN32C
SetConsoleCtrlHandler(wbreak_handler, FALSE);
+#else
+ (void) LSIGNAL(SIGINT, SIG_DFL);
#endif
#ifdef SIGTSTP
(void) LSIGNAL(SIGTSTP, SIG_DFL);
@@ -200,7 +205,7 @@ init_signals(on)
* A received signal cause a bit to be set in "sigs".
*/
public void
-psignals()
+psignals(VOID_PARAM)
{
int tsignals;
@@ -254,8 +259,8 @@ psignals()
wscroll = (sc_height + 1) / 2;
calc_jump_sline();
calc_shift_count();
- screen_trashed = 1;
}
+ screen_trashed = 1;
}
#endif
if (tsignals & S_INTERRUPT)