Skip to content

Commit

Permalink
Fix building against ncursesw on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
thp committed Mar 19, 2018
1 parent fc4f823 commit 82f3638
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/creddit.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ifdef F_MACOSX
CREDDIT_LDFLAGS+=-lncurses
else
CREDDIT_LDFLAGS+=-lncursesw
CREDDIT_CFLAGS+=-DCREDDIT_USE_NCURSESW
endif

ifdef STATIC
Expand Down
4 changes: 4 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
#include <string.h>
#include <stdbool.h>
#include "reddit.h"
#if defined(CREDDIT_USE_NCURSESW)
#include <ncursesw/curses.h>
#else
#include <ncurses.h>
#endif
#include <form.h>
#include <locale.h>

Expand Down

1 comment on commit 82f3638

@qguv
Copy link

@qguv qguv commented on 82f3638 Jun 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit breaks the build on modern systems that use ncursesw as the default ncurses. Rather than force a definition of CREDDIT_USE_NCURSESW on non-mac systems, it would be nice it were left for the user to define (or not) when running make. Alternatively, creddit.mk could detect whether an ncursesw/ directory exists in any includes dir. Unfortunately I don't know enough mk to make this change myself.

Please sign in to comment.