misc/84219: ncurses.h wchar_t confliction

Hye-Shik Chang perky at FreeBSD.org
Thu Jul 28 12:20:23 GMT 2005


>Number:         84219
>Category:       misc
>Synopsis:       ncurses.h wchar_t confliction
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 28 12:20:21 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Hye-Shik Chang
>Release:        FreeBSD 7.0-CURRENT
>Organization:
Yonsei University
>Environment:
FreeBSD alice.liko.co.kr 7.0-CURRENT FreeBSD 7.0-CURRENT #1: Sun Jul 17 09:46:00 KST 2005     root at alice.liko.co.kr:/usr/obj/usr/src/sys/NONDEBUG  i386

>Description:
When _XOPEN_SOURCE_EXTENDED is defined, ncurses.h conflicts
agains stdlib.h.  ncurses.h checks whether __wchar_t macro is defined,
but FreeBSD's __wchar_t isn't a macro but typedef.  So we need to
change the condition to defined(_WCHAR_T_DECLARED).


>How-To-Repeat:

try compile the following: (which is digested from Python aclocal.m4)

#define _XOPEN_SOURCE_EXTENDED 1
#include <stdlib.h>
#include <ncurses.h>


>Fix:

--- lib/libncurses/Makefile.orig	Thu Jul 28 17:57:12 2005
+++ lib/libncurses/Makefile	Thu Jul 28 17:56:29 2005
@@ -371,7 +371,7 @@
 	    -e "s%@cf_cv_type_of_bool@%${TYPE_OF_BOOL}%g" \
 	    -e "s%@cf_cv_typeof_chtype@%${TYPEOF_CHTYPE}%g" \
 	    -e "s%@cf_cv_widec_shift@%${WIDEC_SHIFT}%g" \
-	    -e "s/ _WCHAR_T/ __wchar_t/g" \
+	    -e "s/#ifndef _WCHAR_T/#ifndef _WCHAR_T_DECLARED/g" \
 	    -e "s/ _WINT_T/ __wint_t/g" \
 
 unctrl.h:	unctrl.h.in

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list