wangp / bower

A curses terminal client for the Notmuch email system
Other
119 stars 11 forks source link

Fix build failure with GCC-14 #120

Closed NHOrus closed 1 month ago

NHOrus commented 1 month ago

I dunno why includes don't propagate to this function. I don't know Mercury. I find simplest method to fix it to be re-declaring function with correct signature. Also added linking flag to fix link-time failure found after first error was cleared.

Closes #119 possibly badly

wangp commented 1 month ago

It looks like Gentoo requires these changes:

diff --git a/src/Mercury.options b/src/Mercury.options
index 64e93e2..051e41a 100644
--- a/src/Mercury.options
+++ b/src/Mercury.options
@@ -6,7 +6,7 @@ GRADE = hlc.gc
 MCFLAGS += --grade $(GRADE)

 # Link with curses.
-MLLIBS-bower += -lncursesw -lpanelw
+MLLIBS-bower += -lncursesw -lpanelw -ltinfow

 # Build with gpgme.
 CFLAGS += -D_FILE_OFFSET_BITS=64
diff --git a/src/curs.m b/src/curs.m
index 5c036be..0fd3647 100644
--- a/src/curs.m
+++ b/src/curs.m
@@ -377,8 +377,8 @@

 :- pragma foreign_decl("C", "

-#include <ncurses.h>
-#include <panel.h>
+#include <ncursesw/ncurses.h>
+#include <ncursesw/panel.h>
 #include <wchar.h>

 #ifdef NCURSES_VERSION

I'm not sure what to do about it at the moment as making those changes will break the build on other distributions.

wangp commented 1 month ago

I've pushed a change. On Gentoo, please run: make WITH_NCURSESW_DIR=1