about summary refs log tree commit diff stats
path: root/termbox
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-08-18 09:13:44 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-08-18 09:13:44 -0700
commit72d868e6460e9189ab6ca9b4f4feae3d58db6f80 (patch)
treed479f65451b4766c1422e2b7b6a278c10c34f639 /termbox
parent9393ccc8598bbecc6a6e7f61f1a28a3bf5d5a2e6 (diff)
downloadmu-72d868e6460e9189ab6ca9b4f4feae3d58db6f80.tar.gz
3222
Commit 3191 stopped defining _XOPEN_SOURCE when building termbox/ to get
Mu to build on OpenBSD. However, that had the side effect of not
declaring the prototype for wcwidth() on some versions of Linux. Ugh.
Just hack around this morass.

In general the direction we want to go in Mu is fewer feature #defines.
At least explicit ones. Should be an internal detail of the underlying
platform our code shouldn't have to worry about. If headers don't
cooperate, just start explicitly declaring prototypes and damn the
consequences.
Diffstat (limited to 'termbox')
-rw-r--r--termbox/termbox.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/termbox/termbox.c b/termbox/termbox.c
index 79e6e3cc..e7757f9a 100644
--- a/termbox/termbox.c
+++ b/termbox/termbox.c
@@ -12,6 +12,10 @@
 #include <termios.h>
 #include <unistd.h>
 #include <wchar.h>
+/* hack: we can't define _XOPEN_SOURCE because that causes OpenBSD to not
+ * include SIGWINCH. But then this prototype is not included on Linux,
+ * triggering a warning. */
+extern int wcwidth (wchar_t);
 
 #include "termbox.h"