try to fix the use of ncurses extensions in colors.h

Mon, 31 Aug 2026 18:35:13 +0200

author
Mike Becker <universe@uap-core.de>
date
Mon, 31 Aug 2026 18:35:13 +0200
changeset 204
86c09da7a6ae
parent 203
1d5c2ad2ac23
child 205
4d452a723d96

try to fix the use of ncurses extensions in colors.h

configure file | annotate | diff | comparison | revisions
make/project.xml file | annotate | diff | comparison | revisions
src/colors.c file | annotate | diff | comparison | revisions
src/colors.h file | annotate | diff | comparison | revisions
--- a/configure	Mon Aug 31 18:22:04 2026 +0200
+++ b/configure	Mon Aug 31 18:35:13 2026 +0200
@@ -604,6 +604,8 @@
     if [ $VERR -ne 0 ]; then
         return 1
     fi
+        TEMP_CFLAGS="$TEMP_CFLAGS -DUSE_POSIX_CURSES"
+        TEMP_CXXFLAGS="$TEMP_CXXFLAGS -DUSE_POSIX_CURSES"
     return 0
 }
 checkopt_curses_ncurses()
@@ -630,6 +632,8 @@
     fi
         TEMP_CFLAGS="$TEMP_CFLAGS -DDISABLE_UNICODE"
         TEMP_CXXFLAGS="$TEMP_CXXFLAGS -DDISABLE_UNICODE"
+        TEMP_CFLAGS="$TEMP_CFLAGS -DUSE_POSIX_CURSES"
+        TEMP_CXXFLAGS="$TEMP_CXXFLAGS -DUSE_POSIX_CURSES"
     return 0
 }
 
--- a/make/project.xml	Mon Aug 31 18:22:04 2026 +0200
+++ b/make/project.xml	Mon Aug 31 18:35:13 2026 +0200
@@ -69,6 +69,7 @@
             </value>
             <value str="cursesw">
                 <dependencies>cursesw</dependencies>
+                <define name="USE_POSIX_CURSES"/>
             </value>
             <value str="ncurses">
                 <dependencies>ncurses</dependencies>
@@ -77,6 +78,7 @@
             <value str="curses">
                 <dependencies>curses</dependencies>
                 <define name="DISABLE_UNICODE"/>
+                <define name="USE_POSIX_CURSES"/>
             </value>
             <default value="ncursesw"/>
             <default value="cursesw"/>
--- a/src/colors.c	Mon Aug 31 18:22:04 2026 +0200
+++ b/src/colors.c	Mon Aug 31 18:35:13 2026 +0200
@@ -31,8 +31,10 @@
 #include <curses.h>
 
 void init_colorpairs(void) {
+#ifndef USE_POSIX_CURSES
     use_default_colors();
     init_pair(COL_APP, -1, -1);
+#endif
     init_pair(COL_BW, COLOR_BLACK, COLOR_CYAN);
     init_pair(COL_BB, COLOR_BLACK, COLOR_BLUE);
     init_pair(COL_WB, COLOR_WHITE, COLOR_BLUE);
--- a/src/colors.h	Mon Aug 31 18:22:04 2026 +0200
+++ b/src/colors.h	Mon Aug 31 18:35:13 2026 +0200
@@ -30,7 +30,11 @@
 #ifndef COLORS_H
 #define COLORS_H
 
+#ifdef USE_POSIX_CURSES
+#define COL_APP 0
+#else
 #define COL_APP 1
+#endif
 #define COL_BW 2
 #define COL_WB 3
 #define COL_BB 4

mercurial