sup

A curses threads-with-tags style email client

ncursesw-ruby.git

git clone https://supmua.dev/git/ncursesw-ruby/
commit 1d5140f93a15ff34c1d29183e4a544d96da4033f
parent 456b5de51b825a18cdbb752f066f27821c19f88a
Author: Steven Lawrance <stl@koffein.net>
Date:   Mon, 24 Jun 2013 21:29:09 +0200

Don't meddle with window delay on FreeBSD

Although the pointer dereference itself seems fine, setting
the window delay to 0 in rbncurshelper_nonblocking_wgetch()
triggers a segfault in is_wintouched() and seems unnecessary
anyway.

Diffstat:
M extconf.rb | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/extconf.rb b/extconf.rb
@@ -146,8 +146,13 @@ if have_func("rb_thread_fd_select")
   $CFLAGS  += " -DHAVE_RB_THREAD_FD_SELECT"
 end
 
-# add NCURSES_OPAQUE for mac
-$CFLAGS += " -DNCURSES_OPAQUE=0"
+# Avoid dereferencing WINDOW pointers on FreeBSD
+if RUBY_PLATFORM =~ /freebsd/
+  $CFLAGS += " -DNCURSES_OPAQUE=1"
+else
+  # add NCURSES_OPAQUE for mac
+  $CFLAGS += " -DNCURSES_OPAQUE=0"
+end
 
 if have_func("clock_gettime")
   $CFLAGS += " -DHAVE_CLOCK_GETTIME"