nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit e8abbc70456648b02fe22f08d676d8218e7e852a
parent 235f92ce093099cd81f14827ab842bd331132790
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Wed, 16 Sep 2020 12:11:09 +0200

build: stop using an obsolete macro, and use 'void' for signal handlers

The Autoconf manual says that 'AC_TYPE_SIGNAL' is obsolete and
that it is fine to simply use 'void' instead of 'RETSIGTYPE'.

Diffstat:
Mconfigure.ac | 4----
Msrc/files.c | 2+-
Msrc/nano.c | 12++++++------
Msrc/prototypes.h | 10+++++-----
4 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/configure.ac b/configure.ac @@ -543,10 +543,6 @@ dnl Checks for available flags. AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"], [], []) -dnl Checks for library functions. - -AC_TYPE_SIGNAL - dnl Checks for libraries. if eval "test x$CURSES_LIB_NAME = x"; then diff --git a/src/files.c b/src/files.c @@ -916,7 +916,7 @@ static pid_t pid_of_command = -1; /* The PID of a forked process -- needed when wanting to abort it. */ /* Send an unconditional kill signal to the running external command. */ -RETSIGTYPE cancel_the_command(int signal) +void cancel_the_command(int signal) { kill(pid_of_command, SIGKILL); } diff --git a/src/nano.c b/src/nano.c @@ -780,7 +780,7 @@ void version(void) } /* Register that Ctrl+C was pressed during some system call. */ -RETSIGTYPE make_a_note(int signal) +void make_a_note(int signal) { control_C_was_pressed = TRUE; } @@ -915,21 +915,21 @@ void signal_init(void) } /* Handler for SIGHUP (hangup) and SIGTERM (terminate). */ -RETSIGTYPE handle_hupterm(int signal) +void handle_hupterm(int signal) { die(_("Received SIGHUP or SIGTERM\n")); } #if !defined(NANO_TINY) && !defined(DEBUG) /* Handler for SIGSEGV (segfault) and SIGABRT (abort). */ -RETSIGTYPE handle_crash(int signal) +void handle_crash(int signal) { die(_("Sorry! Nano crashed! Code: %d. Please report a bug.\n"), signal); } #endif /* Handler for SIGTSTP (suspend). */ -RETSIGTYPE do_suspend(int signal) +void do_suspend(int signal) { #ifdef ENABLE_MOUSE disable_mouse_support(); @@ -971,7 +971,7 @@ void do_suspend_void(void) } /* Handler for SIGCONT (continue after suspend). */ -RETSIGTYPE do_continue(int signal) +void do_continue(int signal) { #ifdef ENABLE_MOUSE if (ISSET(USE_MOUSE)) @@ -1013,7 +1013,7 @@ void block_sigwinch(bool blockit) #ifndef NANO_TINY /* Handler for SIGWINCH (window size change). */ -RETSIGTYPE handle_sigwinch(int signal) +void handle_sigwinch(int signal) { /* Let the input routine know that a SIGWINCH has occurred. */ the_window_resized = TRUE; diff --git a/src/prototypes.h b/src/prototypes.h @@ -403,17 +403,17 @@ void restore_handler_for_Ctrl_C(void); #ifndef NANO_TINY void reconnect_and_store_state(void); #endif -RETSIGTYPE handle_hupterm(int signal); +void handle_hupterm(int signal); #ifndef DEBUG -RETSIGTYPE handle_crash(int signal); +void handle_crash(int signal); #endif -RETSIGTYPE do_suspend(int signal); -RETSIGTYPE do_continue(int signal); +void do_suspend(int signal); +void do_continue(int signal); #if !defined(NANO_TINY) || defined(ENABLE_SPELLER) || defined(ENABLE_COLOR) void block_sigwinch(bool blockit); #endif #ifndef NANO_TINY -RETSIGTYPE handle_sigwinch(int signal); +void handle_sigwinch(int signal); void compute_the_extra_rows_per_line_from(linestruct *fromline); void regenerate_screen(void); void do_toggle(int flag);