On Tue, Jun 29, 2010 at 8:25 AM, John Hunter <jdh2...@gmail.com> wrote:

> This issue is new and not related to the issue on the cookbook, I'm
> pretty sure.  I have the same problem on my box at work, and it was
> introduced when I upgraded to CXX6.  I have spent some time on it but
> haven't found the fix yet.  I guess it's my bug :-(
>
> I've added it to the tracker:
>
> https://sourceforge.net/tracker/?func=detail&aid=3022815&group_id=80706&atid=560720
>

I have a fix in that appears to work.  Comments from the tracker
below.  If anyone sees a problem with my fix, let me know::

The CXX/WrapPython.h header has the following code to deal with the swab
issue

// Prevent multiple conflicting definitions of swab from stdlib.h and
unistd.h
#if defined(__sun) || defined(sun)
#if defined(_XPG4)
#undef _XPG4
#endif
#endif

See
http://cxx.svn.sourceforge.net/viewvc/cxx/trunk/CXX/CXX/WrapPython.h?revision=198&content-type=text%2Fplain

The header of stdlib.h on the sage tracker and on my solaris system say
this:

/*
* swab() has historically been in <stdlib.h> as delivered from AT&T
* and continues to be visible in the default compilation environment.
* As of Issue 4 of the X/Open Portability Guides, swab() was declared
* in <unistd.h>. As a result, with respect to X/Open namespace the
* swab() declaration in this header is only visible for the XPG3
* environment.
*/

Ie, the swab declaration is visible for the XPG3 environment but
WrapperPython.h is only unsetting XPG$. The proposed fix is to also unset
XPG3 in this environment. I don't pfully understand all these macros, but
this seems consistent with the comments in stdlib and with what WrapPython
is trying to do, and it works (mpl compiles and passes tests).

So I am committing the following change to mpl's CXX (this should also be
pushed upstream into CXX where we might get better feedback on whether this
change is indeed correct).

// Prevent multiple conflicting definitions of swab from stdlib.h and
unistd.h
#if defined(__sun) || defined(sun)
#if defined(_XPG4)
#undef _XPG4
#endif
#if defined(_XPG3)
#undef _XPG3
#endif
#endif

JDH

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to