From nobody@FreeBSD.org  Sat Apr 23 19:46:10 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 967C21065677
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 23 Apr 2011 19:46:10 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 854758FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 23 Apr 2011 19:46:10 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p3NJkAZm032909
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 23 Apr 2011 19:46:10 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p3NJkATt032908;
	Sat, 23 Apr 2011 19:46:10 GMT
	(envelope-from nobody)
Message-Id: <201104231946.p3NJkATt032908@red.freebsd.org>
Date: Sat, 23 Apr 2011 19:46:10 GMT
From: Stephen Hurd <shurd@sasktel.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: New dialog.h undefines ERR making curses macros unavailable
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         156601
>Category:       bin
>Synopsis:       dialog(1): new dialog.h undefines ERR making curses macros unavailable
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    nwhitehorn
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 23 19:50:12 UTC 2011
>Closed-Date:    Sun Jun 19 08:55:19 UTC 2011
>Last-Modified:  Sun Jun 19 09:00:22 UTC 2011
>Originator:     Stephen Hurd
>Release:        9.0-CURRENT
>Organization:
>Environment:
FreeBSD  9.0-CURRENT FreeBSD 9.0-CURRENT #1: Sat Apr 23 10:37:10 UTC 2011       root@:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
The new dialog.h on line 47 undefines the ERR macro with a comment of "header conflict with Solaris xpg4" this means that if n?curses.h is included before dialog.h, ERR becomes undefined and the various macros in curses.h (ie: getmaxy()) break.

Since our curses.h #undef's ERR itself, there is no need for this in FreeBSD, and since it requires specific #include ordering for no good reason, it should be removed.
>How-To-Repeat:
#include <curses.h>
#include <dialog.h>
#include <stdio.h>

int main(int argc, char **argv)
{
    initscr();
    fprintf(stderr, "%d\n", getmaxy(stdscr));
    endwin();
    return 0;
}

>Fix:
Remove line 47 of dialog.h for FreeBSD

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->nwhitehorn 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Apr 23 21:43:30 UTC 2011 
Responsible-Changed-Why:  
Over to committer of most recent change. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156601 
State-Changed-From-To: open->closed 
State-Changed-By: jh 
State-Changed-When: Sun Jun 19 08:55:18 UTC 2011 
State-Changed-Why:  
Fixed in r223289. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=156601 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/156601: commit references a PR
Date: Sun, 19 Jun 2011 08:53:30 +0000 (UTC)

 Author: jh
 Date: Sun Jun 19 08:53:16 2011
 New Revision: 223289
 URL: http://svn.freebsd.org/changeset/base/223289
 
 Log:
   Don't #undef curses ERR in dialog.h. Otherwise, the macro will be
   unavailable if curses.h is included before dialog.h.
   
   PR:		bin/156601
   Obtained from:	Thomas E. Dickey (upstream maintainer)
   Discussed with:	nwhitehorn
 
 Modified:
   head/contrib/dialog/dialog.h
 
 Modified: head/contrib/dialog/dialog.h
 ==============================================================================
 --- head/contrib/dialog/dialog.h	Sun Jun 19 08:34:10 2011	(r223288)
 +++ head/contrib/dialog/dialog.h	Sun Jun 19 08:53:16 2011	(r223289)
 @@ -1,5 +1,5 @@
  /*
 - *  $Id: dialog.h,v 1.223 2011/03/02 10:04:09 tom Exp $
 + *  $Id: dialog.h,v 1.224 2011/06/13 14:29:42 tom Exp $
   *
   *  dialog.h -- common declarations for all dialog modules
   *
 @@ -44,7 +44,10 @@
  #include <signal.h>	/* fork() etc. */
  #include <math.h>	/* sqrt() */
  
 -#undef ERR		/* header conflict with Solaris xpg4 */
 +/* header conflict with Solaris xpg4 versus <sys/regset.h> */
 +#if defined(ERR) && (ERR == 13)
 +#undef ERR
 +#endif
  
  #if defined(HAVE_NCURSESW_NCURSES_H)
  #include <ncursesw/ncurses.h>
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
