From d20abf75ed3fc827f9fbf187beaf69d3fd35bf70 Mon Sep 17 00:00:00 2001 From: heck Date: Wed, 14 Dec 2022 00:46:30 +0100 Subject: [PATCH] refactor: move #staticni into base.h and curses stuff into term_util.h --- src/base.h | 2 ++ src/term_util.h | 5 +++++ src/tui_main.c | 9 --------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/base.h b/src/base.h index 4485c4e..6c3a55b 100644 --- a/src/base.h +++ b/src/base.h @@ -57,6 +57,8 @@ #define ORCA_ARRAY_COUNTOF(_array) (sizeof(_array) / sizeof(_array[0])) #endif +#define staticni ORCA_NOINLINE static + #define ORCA_Y_MAX UINT16_MAX #define ORCA_X_MAX UINT16_MAX diff --git a/src/term_util.h b/src/term_util.h index bf0c17b..0e1f04d 100644 --- a/src/term_util.h +++ b/src/term_util.h @@ -13,6 +13,11 @@ #define CTRL_PLUS(c) ((c)&037) +#if NCURSES_VERSION_PATCH < 20081122 +int _nc_has_mouse(void); + #define has_mouse _nc_has_mouse +#endif + struct oso; typedef enum diff --git a/src/tui_main.c b/src/tui_main.c index d2ee8e6..8ed8027 100644 --- a/src/tui_main.c +++ b/src/tui_main.c @@ -14,21 +14,12 @@ #include "sokol_time.h" #undef SOKOL_IMPL -#ifdef FEAT_PORTMIDI - #include -#endif - -#if NCURSES_VERSION_PATCH < 20081122 -int _nc_has_mouse(void); - #define has_mouse _nc_has_mouse -#endif #define TIME_DEBUG 0 #if TIME_DEBUG static int spin_track_timeout = 0; #endif -#define staticni ORCA_NOINLINE static staticni void usage(void) { // clang-format off