~nloomans/ft_select

a4ef762331941c5e33670f7bf81eb964fb761edb — Noah Loomans 1 year, 8 months ago 2e75cb9
fix build on linux

The SIGSYS signal has a higher index on Linux:

../src/handle.c:62:3: error: array index in initializer exceeds array bounds
   62 |  [SIGSYS] = { .handler = handle_exit_signal },
      |   ^~~~~~
../src/handle.c:62:3: note: (near initialization for ‘g_handle_signal_map’)

Also setting --std=c99 unfortunately disallowed the usage of
sys_siglist.
3 files changed, 2 insertions(+), 3 deletions(-)

M inc/handle.h
M meson.build
M src/handle.c
M inc/handle.h => inc/handle.h +1 -1
@@ 23,7 23,7 @@ struct									s_handle_signal_map
	void		(*handler)(int signum);
};

extern const struct s_handle_signal_map	g_handle_signal_map[29];
extern const struct s_handle_signal_map	g_handle_signal_map[32];
extern const t_action 					g_handle_key_map[READ_TYPE_AMOUNT][256];

#endif

M meson.build => meson.build +0 -1
@@ 2,7 2,6 @@ project(
  'ft_select',
  'c',
  default_options: [
    'c_std=c99',
    'warning_level=3',
    'werror=true',
  ]

M src/handle.c => src/handle.c +1 -1
@@ 49,7 49,7 @@ static void							handle_exit_signal(int signum)
	exit(1);
}

const struct s_handle_signal_map	g_handle_signal_map[29] = {
const struct s_handle_signal_map	g_handle_signal_map[32] = {
	[SIGHUP]	= { .handler = handle_exit_signal },
	[SIGINT]	= { .handler = handle_exit_signal },
	[SIGQUIT]	= { .handler = handle_exit_signal },