From 15a5254f04ebfaad7635320c28e08bef47f8989d Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 29 Mar 2021 17:54:39 +0900 Subject: [PATCH] [build] Get ncurses support working again Some minor errors dues to getting win32 building (and not testing the results properly in Linux). --- config.d/curses.m4 | 8 ++++---- libs/console/server.c | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/config.d/curses.m4 b/config.d/curses.m4 index 6a5757cc1..2e24c0d84 100644 --- a/config.d/curses.m4 +++ b/config.d/curses.m4 @@ -19,19 +19,19 @@ if test "x$enable_curses" != "xno"; then ) ) if test "x$NCURSES_LIBS" != "x"; then - AC_DEFINE(HAVE_CURSES, 1, [Define if you have the ncurses library]) - HAVE_CURSES=yes + HAVE_NCURSES=yes else - HAVE_CURSES=no + HAVE_NCURSES=no fi fi else - HAVE_CURSES=no + HAVE_NCURSES=no NCURSES_LIBS= fi AC_SUBST(NCURSES_LIBS) if test "x$HAVE_NCURSES" == "xyes"; then + AC_DEFINE(HAVE_NCURSES, 1, [Define if you have the ncurses library]) if test "x$PKG_CONFIG" != "x"; then PKG_CHECK_MODULES([PANEL], [panel], HAVE_PANEL=yes, HAVE_PANEL=no) else diff --git a/libs/console/server.c b/libs/console/server.c index a621bcc2b..005efb786 100644 --- a/libs/console/server.c +++ b/libs/console/server.c @@ -31,7 +31,7 @@ # include "config.h" #endif -#ifdef HAVE_CURSES +#ifdef HAVE_NCURSES # include #endif #ifdef HAVE_STRING_H @@ -84,7 +84,7 @@ static cvar_t *sv_conmode; static void C_KeyEvent (knum_t key, short unicode, qboolean down); -#ifdef HAVE_CURSES +#ifdef HAVE_NCURSES enum { sv_resize_x = 1, @@ -682,7 +682,7 @@ sv_conmode_f (cvar_t *var) static void C_Init (void) { -#ifdef HAVE_CURSES +#ifdef HAVE_NCURSES cvar_t *curses = Cvar_Get ("sv_use_curses", "0", CVAR_ROM, NULL, "Set to 1 to enable curses server console."); use_curses = curses->int_val; @@ -705,7 +705,7 @@ C_shutdown (void) Qclose (log_file); log_file = 0; } -#ifdef HAVE_CURSES +#ifdef HAVE_NCURSES if (use_curses) endwin (); #endif @@ -725,7 +725,7 @@ C_Print (const char *fmt, va_list args) Qputs (log_file, buffer->str); Qflush (log_file); } -#ifdef HAVE_CURSES +#ifdef HAVE_NCURSES if (use_curses) { print (buffer->str); } else @@ -741,7 +741,7 @@ C_Print (const char *fmt, va_list args) static void C_ProcessInput (void) { -#ifdef HAVE_CURSES +#ifdef HAVE_NCURSES if (use_curses) { process_input (); } else @@ -757,7 +757,7 @@ C_ProcessInput (void) static void C_KeyEvent (knum_t key, short unicode, qboolean down) { -#ifdef HAVE_CURSES +#ifdef HAVE_NCURSES key_event (key, unicode, down); #endif }