[Python-bugs-list] [ python-Bugs-641455 ] curses module doesn't build on MacOSX

noreply@sourceforge.net noreply@sourceforge.net
Fri, 22 Nov 2002 02:38:17 -0800


Bugs item #641455, was opened at 2002-11-20 21:45
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=641455&group_id=5470

Category: Extension Modules
>Group: None
>Status: Open
Resolution: Wont Fix
Priority: 5
Submitted By: Jack Jansen (jackjansen)
Assigned to: Martin v. L÷wis (loewis)
Summary: curses module doesn't build on MacOSX

Initial Comment:
The curses module fails to build on MacOSX 10.2.
There is apparently a mismatch between two definitions of wchar_t:

In file included from /Users/jack/src/python/Include/py_curses.h:6,
                 from /Users/jack/src/python/Modules/_cursesmodule.c:113:
/usr/include/ncurses.h:282: conflicting types for `wchar_t'
/usr/include/stdlib.h:77: previous declaration of `wchar_t'

I'm assigning this to you since you seem to be the most frequent committer of cursesmodule.c, so I hope you know what may be going on. Feel free to assign it back if I'm guessing wrong here, and I'll do the hunting. 

----------------------------------------------------------------------

>Comment By: Jack Jansen (jackjansen)
Date: 2002-11-22 11:38

Message:
Logged In: YES 
user_id=45365

Well, ncurses is what Apple ships, so I don't think closing
this as third-party is a good idea. (I have submitted an
Apple bug report, id 3108061).

I've attached a patch that seems to fix the problem:
defining _WCHAR_T if _BSD_WCHAR_T_DEFINED_ is defined.

Assign back to me if you think this is okay.

----------------------------------------------------------------------

Comment By: Martin v. L÷wis (loewis)
Date: 2002-11-22 08:53

Message:
Logged In: YES 
user_id=21627

I'd say it is safe to test for _BSD_WCHAR_T_DEFINED_ in
ncurses.h.

Strictly speaking, you would need to recompile ncurses with
_XOPEN_SOURCE_EXTENDED, but that can be avoided since both
definitions define wchar_t to a four-byte integer type
(there are int-vs-long unsigned-vs-signed issues, but they
should not matter).

Yes, there are a number of functions in ncurses that use
wchar_t, but none of those functions are exposed in Python.

In any case, I'll close this bug as 3rdparty. I recommend
that you don't use ncurses, but use the system curses
library instead.

----------------------------------------------------------------------

Comment By: Jack Jansen (jackjansen)
Date: 2002-11-21 21:54

Message:
Logged In: YES 
user_id=45365

Agreed: the two headers protect against mulitply-defining wchar_t, but do so with different symbols (stdlib uses _BSD_WCHAR_T_DEFINED_, ncurses _WCHAR_T).

I could simply define the one if the other is defined (inside an ifdef APPLE, even), but as I'm not familiar with curses at all I don't know whether that would break anything (i.e. are the wchar_t part of any API, for instance).

----------------------------------------------------------------------

Comment By: Martin v. L÷wis (loewis)
Date: 2002-11-21 00:04

Message:
Logged In: YES 
user_id=21627

Looks like a bug in the system headers to me, if both
stdlib.h and ncurses.h define a type wchar_t, but define
them in different ways.

In case ncurses.h is not a system header, but a package that
you have installed yourself, you should uninstall it - it
apparently has not been ported to OS X.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=641455&group_id=5470