I'm sorry. I had to disable writing to LINES, COLS, curscr, stdscr,
COLORS, COLOR_PAIRS, because with the new NCURSES_REENTRANT lib, writing
is forbidden. It's now wrapped behind a function call.
I believe this affects all platforms, but some ncurses expert
should clarify how to write to LINES now.
diffbk
diff -u ./Curses.c~ ./Curses.c
--- ./Curses.c~ 2008-11-08 05:30:10.000000000 +0100
+++ ./Curses.c 2010-01-19 17:06:55.031250000 +0100
@@ -37,6 +37,10 @@
#undef bool.h in the Mac OSX hints file, so someone presumably found
it necessary. But we have also had a Mac OSX system on which compile
failed _because_ of that undef, for the reason described above.
+
+ If NCURSES_REENTRANT is defined we cannot write to the public vars anymore.
+ This affects LINES, COLS, curscr, stdscr, COLORS, COLOR_PAIRS.
+
*/
#undef instr
@@ -50,6 +54,11 @@
#define NEED_sv_2pv_flags
#include "ppport.h"
+/* If we are lucky we can still write to some vars */
+#ifndef NCURSES_REENTRANT
+#define NCURSES_REENTRANT 0
+#endif
+
#ifndef C_PANELSUPPORT
# define PANEL int
#endif
diff -u ./Curses.pm~ ./Curses.pm
--- ./Curses.pm~ 2009-01-20 16:24:27.000000000 +0100
+++ ./Curses.pm 2010-01-19 16:41:20.843750000 +0100
@@ -51,7 +51,7 @@
package Curses;
-$VERSION = '1.27'; # Makefile.PL picks this up
+$VERSION = '1.28'; # Makefile.PL picks this up
use Carp;
require Exporter;
diff -u ./CursesVar.c~ ./CursesVar.c
--- ./CursesVar.c~ 2007-03-11 09:29:09.000000000 +0100
+++ ./CursesVar.c 2010-01-19 17:02:57.468750000 +0100
@@ -186,42 +186,42 @@
switch (num) {
case 1:
-#ifdef C_LINES
- LINES = (int)SvIV(ST(1));
+#if defined(C_LINES) && !NCURSES_REENTRANT
+ NCURSES_PUBLIC_VAR(LINES) = (int)SvIV(ST(1));
#else
c_var_not_there("LINES");
#endif
break;
case 2:
-#ifdef C_COLS
+#if defined(C_COLS) && !NCURSES_REENTRANT
COLS = (int)SvIV(ST(1));
#else
c_var_not_there("COLS");
#endif
break;
case 3:
-#ifdef C_STDSCR
+#if defined(C_STDSCR) && !NCURSES_REENTRANT
stdscr = c_sv2window(ST(1), -1);
#else
c_var_not_there("stdscr");
#endif
break;
case 4:
-#ifdef C_CURSCR
+#if defined(C_CURSCR) && !NCURSES_REENTRANT
curscr = c_sv2window(ST(1), -1);
#else
c_var_not_there("curscr");
#endif
break;
case 5:
-#ifdef C_COLORS
+#if defined(C_COLORS) && !NCURSES_REENTRANT
COLORS = (int)SvIV(ST(1));
#else
c_var_not_there("COLORS");
#endif
break;
case 6:
-#ifdef C_COLOR_PAIRS
+#if defined(C_COLOR_PAIRS) && !NCURSES_REENTRANT
COLOR_PAIRS = (int)SvIV(ST(1));
#else
c_var_not_there("COLOR_PAIRS");
diff -u ./HISTORY~ ./HISTORY
--- ./HISTORY~ 2009-01-20 16:24:06.000000000 +0100
+++ ./HISTORY 2010-01-19 17:10:02.109375000 +0100
@@ -11,6 +11,12 @@
Curses itself is much older than the Perl implementation. Curses was
originally only a C programming library.
+New in 1.28 (Released January ??, 2010)
+
+ Fixes for NCURSES_REENTRANT by Reini Urban. With NCURSES_REENTRANT
+ defined we cannot write to some puiblic variables anymore, we can only
+ read from LINES, COLS, curscr, stdscr, COLORS, COLOR_PAIRS.
+
New in 1.27 (Released January 20, 2009)
Extraneous .i and .s files in 1.26 removed. 'make clean' cleans all
diff -u ./c-config.h~ ./c-config.h
--- ./c-config.h~ 2010-01-19 15:26:14.437500000 +0100
+++ ./c-config.h 2010-01-19 16:59:38.515625000 +0100
@@ -5,7 +5,8 @@
*/
/* These hints thanks to Federico Spinazzi <spinazzi@databankgroup.it>
- (2001) and yselkowitz@users.sourceforge.net (October 2005)
+ (2001), yselkowitz@users.sourceforge.net (October 2005),
+ Reini Urban (January 2010).
*/
#include <ncurses.h>