[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation

2016-08-15 Thread Ned Deily

Ned Deily added the comment:

I have no special insight into this one but, since there seems to be general 
agreement here that this makes things better for those using C++ on OS X and 
FreeBSD, I guess it's time to try it.  Pushed for release in 2.7.13, 3.5.3, and 
3.6.0.

Thanks for the version update, Dimitry.  BTW, it would be good if you signed 
the PSF Contributor Agreement 
(https://www.python.org/psf/contrib/contrib-form/).

--
priority: release blocker -> 
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation

2016-08-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2f857ac9c7af by Ned Deily in branch '3.5':
Issue #10910: Avoid C++ compilation errors on FreeBSD and OS X.
https://hg.python.org/cpython/rev/2f857ac9c7af

New changeset 27a99a722828 by Ned Deily in branch '3.5':
Issue #10910: Update FreedBSD version checks for the ctype UTF-8 workaround.
https://hg.python.org/cpython/rev/27a99a722828

New changeset 5ca8790f1161 by Ned Deily in branch 'default':
Issue #10910: merge from 3.5
https://hg.python.org/cpython/rev/5ca8790f1161

New changeset e0ec3471cb09 by Ned Deily in branch '2.7':
Issue #10910: Avoid C++ compilation errors on FreeBSD and OS X.
https://hg.python.org/cpython/rev/e0ec3471cb09

New changeset 12a70477db03 by Ned Deily in branch '2.7':
Issue #10910: Update FreedBSD version checks for the ctype UTF-8 workaround.
https://hg.python.org/cpython/rev/12a70477db03

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation

2016-08-09 Thread koobs

koobs added the comment:

@Brett / Ned I'm happy to carry the proposed patch in the FreeBSD 
ports/packages until the next releases if that helps your confidence levels.

--
versions: +Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation

2016-08-08 Thread Brett Cannon

Brett Cannon added the comment:

What do you think, Ned?

--
assignee: ronaldoussoren -> ned.deily
nosy: +benjamin.peterson, brett.cannon, georg.brandl, larry, ned.deily
priority: normal -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation

2016-07-28 Thread Mihai Capotă

Changes by Mihai Capotă :


--
nosy: +mihaic

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation

2016-04-03 Thread Dimitry Andric

Dimitry Andric added the comment:

I am a FreeBSD committer, and I recently ran into this issue too, since I am 
working on an update of libc++ in the FreeBSD base system.  As part of this 
work, we attempt to recompile all ports with the proposed change (see [1]).  
During such a recompile, we get many errors in ports that include pyport.h in 
C++ mode, similar to (see [2]):

In file included from scipy/interpolate/src/_interpolate.cpp:4:
In file included from scipy/interpolate/src/interpolate.h:3:
In file included from /usr/include/c++/v1/iostream:38:
In file included from /usr/include/c++/v1/ios:216:
/usr/include/c++/v1/__locale:468:15: error: C++ requires a type specifier for 
all declarations
char_type toupper(char_type __c) const
  ^
/usr/local/include/python2.7/pyport.h:731:29: note: expanded from macro 
'toupper'
#define toupper(c) towupper(btowc(c))
^

I think Ronald's proposed workaround is fine, since messing with ctype macros 
is risky in C++ mode.  E.g. the libc++  header explicitly undefines 
all ctype macros, and replaces them with inline functions.

Additionally, the original issue mentioned in changeset 32950 [3] was fixed in 
October 2007 for FreeBSD 8.x [4], and subsequently the fix was merged back to 
FreeBSD 6.x and 7.x [5].

I'm adding an additional diff that corrects the __FreeBSD_version number 
checks.  This will also be submitted to the FreeBSD ports bug tracker.

[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208158
[2] 
http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-03-22_18h30m05s/logs/errors/py27-scipy-0.16.1.log
[3] https://hg.python.org/cpython/rev/adfe7d39a049
[4] https://svnweb.freebsd.org/base?view=revision=172619
[5] https://svnweb.freebsd.org/base?view=revision=172929

--
nosy: +dim
Added file: http://bugs.python.org/file42359/issue10910-fix-versionchecks-1.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2015-02-02 Thread koobs

Changes by koobs koobs.free...@gmail.com:


--
nosy: +koobs

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2013-07-06 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The bytes_methods.h issue is not present in the default branch, but is still 
present in the 2.7 branch. I'm not sure why those defines are there, I'm adding 
Gregory P. Smith to the nosy list because he added the defines and might 
remember why they were added and if it would be save to remove them (from 
bytes_methods.h).

That is defines like this:

#undef islower
#define islower(c) undefined_islower(c)


I don't know what to do about the defines in pyport.h, one workaround is 
disable that entire block for C++ compiler, as in the attached patches (the 
later one is the same as the first one, but adds a comment that explains why 
the code is disabled for C++)

--
nosy: +gregory.p.smith
versions: +Python 3.4
Added file: http://bugs.python.org/file30805/issue10910-workaround.txt

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2013-07-06 Thread Gregory P. Smith

Gregory P. Smith added the comment:

I was merely refactoring for PEP3137, the original version of all that code 
prior to 2.7 was in Objects/stringobject.c and long predates me.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2013-07-06 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I've some more digging to do then, although I expect that nobody knows anymore 
why the #define's are there. It should be safe to remove them by now, and they 
are not present in the default branch.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2012-06-24 Thread Barry Alan Scott

Barry Alan Scott barry-sc...@users.sourceforge.net added the comment:

I'm happy to review patches or create them for you.

I see a related set of errors on Mac OS X that are down to issues in 
bytes_methods.py that mirror the pyport.h issues.

In C++ isspace and friends are functions not macros.
You cannot go around defining them.

Here are the lines in python2.7 that cause compilation errors for me.

/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/bytes_methods.h:#undef
 isspace
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/bytes_methods.h:#define
 isspace(c) undefined_isspace(c)

--
nosy: +barry-scott

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2012-02-04 Thread Nasos Dousis

Nasos Dousis ndou...@gmail.com added the comment:

Per Chen Huang's comment, I retested my test case code using several versions 
of boost and Python 2.7:

boost 1.45: build fails, errors as reported.
boost 1.46: success.
boost 1.47: success.

I've attached a revised test case that automatically downloads and builds boost 
1.45.

--
Added file: http://bugs.python.org/file24428/test-boost-python.revised.tar.gz

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2012-01-30 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

The only real fix I found is to introduce Py_ prefixed versions of all 
definitions in ctypes.h that are used in Python (that is Py_isalnum) and use 
that throughout the python source tree.

That's a pretty invasive patch though and would probably be off-limit for 2.7 
and 3.2.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2012-01-30 Thread Bert JW Regeer

Bert JW Regeer ber...@regeer.org added the comment:

In my first comment on this bug post I posted what project has issues with 
this, Botan with Boost.Python on FreeBSD and Mac OS X.

If required I will post how to reproduce this error using that project. If you 
would prefer a simplified test case, unfortunately I don't have the time to dig 
into that and find one.

One way to solve it is by including the Python header before any other file, 
however this is not an option for most 3rd party software that never sees this 
bug because those functions are not redefined for Linux...

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2012-01-28 Thread Chen Huang

Chen Huang chi...@gmail.com added the comment:

I am experiencing the same issue. Googled for a bit but couldn't find much with 
the error, then changed the search context, come across to this thread. 


In file included from 
/opt/local/include/boost/date_time/gregorian/parsers.hpp:13,
 from 
/opt/local/include/boost/date_time/gregorian/gregorian.hpp:34,
 from 
/opt/local/include/boost/date_time/posix_time/time_formatters.hpp:12,
 from 
/opt/local/include/boost/date_time/posix_time/posix_time.hpp:24,
 from 
/opt/local/include/boost/date_time/local_time/local_time.hpp:11,
 from /opt/local/include/boost/date_time.hpp:15,
 from /Users/chen/GitRepo/Cpp_EmbeddingPython/Device.h:11,
 from /Users/chen/GitRepo/Cpp_EmbeddingPython/Device.cpp:12:
/opt/local/include/boost/date_time/date_parsing.hpp:50:33: error: macro 
tolower passed 2 arguments, but takes just 1
In file included from /Users/chen/GitRepo/Cpp_EmbeddingPython/Device.cpp:12:
/Users/chen/GitRepo/Cpp_EmbeddingPython/Device.h:13:21: error: Devices.h: No 
such file or directory
In file included from 
/opt/local/include/boost/date_time/gregorian/parsers.hpp:13,
 from 
/opt/local/include/boost/date_time/gregorian/gregorian.hpp:34,
 from 
/opt/local/include/boost/date_time/posix_time/time_formatters.hpp:12,
 from 
/opt/local/include/boost/date_time/posix_time/posix_time.hpp:24,
 from 
/opt/local/include/boost/date_time/local_time/local_time.hpp:11,
 from /opt/local/include/boost/date_time.hpp:15,
 from /Users/chen/GitRepo/Cpp_EmbeddingPython/Device.h:11,
 from /Users/chen/GitRepo/Cpp_EmbeddingPython/Device.cpp:12:
/opt/local/include/boost/date_time/date_parsing.hpp: In function ‘std::string 
boost::date_time::convert_to_lower(std::string)’:
/opt/local/include/boost/date_time/date_parsing.hpp:50: error: cannot resolve 
overloaded function ‘tolower’ based on conversion to type ‘char’
In file included from /Users/chen/GitRepo/Cpp_EmbeddingPython/Device.cpp:12:

--
nosy: +Chen.Huang

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2012-01-28 Thread Chen Huang

Chen Huang chi...@gmail.com added the comment:

if I put #include cctype before boost/date_time, it solves my problem.

And by the way, i can't seem to get to the point where boost/week_ptr.hpp 
causes the error. I tried to compile Nasos's upload test-boost-python. That 
codes works on my machine.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2012-01-28 Thread Chen Huang

Chen Huang chi...@gmail.com added the comment:

Nevermind, putting #include cctype doesn't help. I have to put python.h on 
top to get away this.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2011-07-19 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

Waiting for a new version of boost probably won't help: this is an 
incompatibility between a redefinition of ctypes macros in pyport.h and 
definitions in the C++ header locale.

I barely use C++ at this time and don't know how to tweak the headers to avoid 
this problem. It would probably have been better to not redefine the ctype.h 
definitions, we should have introduced Py_isascii etc. That requires some 
invasive changes to the Python codebase though, and I'm not sure if that is 
worth the trouble.

Could someone attach a sample project that suffers from this issue (with 
instructions on how to build it)? That would make it easier to debug the 
problem.

(Removing python 2.6 because that version receives only security patches at 
this time, adding 3.2 and 3.3 because those use the same code in pyport.h and 
hence should also be affected by this issue)

--
versions: +Python 3.2, Python 3.3 -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2011-07-19 Thread Nasos Dousis

Nasos Dousis ndou...@gmail.com added the comment:

Ronald, thanks again.  I stripped out as much as I could from the
original code and generated the attached project.  In doing so, I
narrowed the problem down to boost/weak_ptr.hpp.

The sample project consists of:

test-boost-python/Makefile
test-boost-python/src
test-boost-python/src/Jamroot
test-boost-python/src/test
test-boost-python/src/test/Jamfile
test-boost-python/src/test/TestBoostPython.cc
test-boost-python/src/test/TestBoostPython.hh
test-boost-python/tools/Makefile

Before building the project (just type make in test-boost-python),
you'll need to download Boost and save it to
test-boost-python/tools/boost/boost.tar.bz2; also, the tools/Makefile
automatically downloads Python 2.7.2, but you can try Python 3.2+ in
its place.

Thanks and kind regards,
Nasos

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2011-07-19 Thread Nasos Dousis

Nasos Dousis ndou...@gmail.com added the comment:

With attachment--

--
Added file: http://bugs.python.org/file22703/test-boost-python.tar.gz

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___

test-boost-python.tar.gz
Description: GNU Zip compressed data
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2011-07-15 Thread Nasos Dousis

Nasos Dousis ndou...@gmail.com added the comment:

Ronald,

Thanks much for your help and insight.  I tried the patch but unfortunately it 
didn't work for me-- this might be because I have Python extensions written in 
C++.

Any other suggestions?  Should I wait for the next version of boost.python?

Thanks and regards,
Nasos

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2011-05-07 Thread Ronald Oussoren

Changes by Ronald Oussoren ronaldousso...@mac.com:


Removed file: http://bugs.python.org/file21728/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2011-05-07 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

The problem is that pyport tries to replace the ctypes definion of the 
isascii(ch) and related functions by a replacement that works better with UTF-8 
on FreeBSD and OSX. That replacement is incompatible with the localfwd.h header.

The attached patch is a very crude hack that should fix the issue for this. 
This assumes that Python itself won't be compiled with C++ though, and might 
cause problems in C++ programs that use locale.h instead of localfwd.h.

As such I won't apply the patch just yet, the patch needs review from someone 
that's more experienced w.r.t. C++.

--
keywords: +needs review, patch
stage:  - patch review
Added file: http://bugs.python.org/file21917/issue10910.txt

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2011-04-19 Thread Nasos Dousis

Nasos Dousis ndou...@gmail.com added the comment:

Meador et al,

Thanks for your attention to this issue.  Just to clarify, I can eliminate
the compile errors by prepending

#include Python.h

to any source file with

#includeboost/python.hpp

Also, my code compiles in Linux, with and without the Python.h header:

$ uname -a
Linux nxx.xx.com 2.6.18-128.1.14.el5 #1 SMP Wed Jun 17 06:38:05 EDT 2009
x86_64 x86_64 x86_64 GNU/Linux

with the same flags as before:

cd $(BOOST); ./bootstrap.sh --prefix=$(CURDIR)/$(BOOST)
--with-python-root=$(CURDIR)/$(PYTHON_DIR) --with-python-version=2.7
--with-libraries=mpi

cd $(PYTHON_SRCDIR) ; ./configure --enable-shared
--prefix=$(CURDIR)/$(PYTHON_DIR)
cd $(PYTHON_SRCDIR) ; make -j $(NUMPROC)  make install

Thanks again,
Nasos

--
Added file: http://bugs.python.org/file21728/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___Meador et al,divbr/divdivThanks for your attention to this issue. 
 Just to clarify, I can eliminate the compile errors by 
prepending /divdivspan class=Apple-style-span style=border-collapse: 
collapse; font-family: arial, sans-serif; font-size: 13px; br
/span/divdiv#span class=Apple-style-span style=border-collapse: 
collapse; font-family: arial, sans-serif; font-size: 13px; include 
quot;Python.hquot;/span/divdivspan class=Apple-style-span 
style=border-collapse: collapse; font-family: arial, sans-serif; font-size: 
13px; br
/span/divdivspan class=Apple-style-span style=border-collapse: 
collapse; font-family: arial, sans-serif; font-size: 13px; to any source file 
with /span/divdivspan class=Apple-style-span style=border-collapse: 
collapse; font-family: arial, sans-serif; font-size: 13px; br
/span/divdivspan class=Apple-style-span style=border-collapse: 
collapse; font-family: arial, sans-serif; font-size: 13px; 
#includelt;boost/python.hppgt;/span/divdivspan 
class=Apple-style-span style=border-collapse: collapse; font-family: arial, 
sans-serif; font-size: 13px; br
/span/divdivspan class=Apple-style-span style=border-collapse: 
collapse; font-family: arial, sans-serif; font-size: 13px; Also, /spanmy 
code compiles in Linux, with and without the Python.h header:/divdiv
meta charset=utf-8divbr/divdiv$ uname -a/divdivLinux a 
href=http://nxx.xx.com;nxx.xx.com/a 2.6.18-128.1.14.el5 #1 SMP Wed Jun 17 
06:38:05 EDT 2009 x86_64 x86_64 x86_64 GNU/Linuxbr/div/divdivbr
/divdivwith the same flags as before:/divdivbr/divdivmeta 
charset=utf-8span class=Apple-style-span style=border-collapse: 
collapse; font-family: arial, sans-serif; font-size: 13px; cd $(BOOST); 
./bootstrap.sh --prefix=$(CURDIR)/$(BOOST) 
--with-python-root=$(CURDIR)/$(PYTHON_DIR) --with-python-version=2.7 
--with-libraries=mpibr
brcd $(PYTHON_SRCDIR) ; ./configure --enable-shared 
--prefix=$(CURDIR)/$(PYTHON_DIR)brcd $(PYTHON_SRCDIR) ; make -j $(NUMPROC) 
amp;amp; make installbr/span/divdivspan class=Apple-style-span 
style=border-collapse: collapse; font-family: arial, sans-serif; font-size: 
13px; br
/span/divdivspan class=Apple-style-span style=border-collapse: 
collapse; font-family: arial, sans-serif; font-size: 13px; Thanks 
again,/span/divdivspan class=Apple-style-span style=border-collapse: 
collapse; font-family: arial, sans-serif; font-size: 13px; Nasos/span/div
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2011-04-17 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

This doesn't look like it has anything to to with the 'ctypes' library
component (http://docs.python.org/library/ctypes).  So I am removing
'ctypes' from the 'Components' selection.  Please correct me if I am
wrong ...

--
components:  -Extension Modules, Library (Lib), Macintosh, Unicode, ctypes
nosy: +meador.inge

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2011-04-17 Thread Meador Inge

Changes by Meador Inge mead...@gmail.com:


--
components: +Macintosh

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2011-03-09 Thread Nasos Dousis

Nasos Dousis ndou...@gmail.com added the comment:

I'm upgrading from Python 2.6.5 to 2.7.1, and I'm getting the error below when 
compiling my code using Boost 1.45 and gcc 4.2.1 in OSX 10.6.6.  The following 
thread describes similar symptoms related to the ordering of header files and 
macro definitions:
http://code.google.com/p/unladen-swallow/issues/detail?id=87#c13

The suggested patch to pyport.h 
(http://codereview.appspot.com/179049/patch/1/2) does not fix my problem.  
However, prepending 

#include Python.h

to each source file (e.g., bend.cc below) does fix the problem.  Is there a 
simple way to fix this without adding Python.h to every source file in my 
codebase?

I've installed Boost and Python from source to non-standard directories, Boost 
1.45 by:
cd $(BOOST); ./bootstrap.sh --prefix=$(CURDIR)/$(BOOST) 
--with-python-root=$(CURDIR)/$(PYTHON_DIR) --with-python-version=2.7 
--with-libraries=mpi

and Python 2.7 by:
cd $(PYTHON_SRCDIR) ; ./configure --enable-shared 
--prefix=$(CURDIR)/$(PYTHON_DIR)
cd $(PYTHON_SRCDIR) ; make -j $(NUMPROC)  make install

Any guidance will be greatly appreciated.

Kind regards,
Nasos

===
...
darwin.compile.c++ bin/darwin-4.2.1/release/threading-multi/bend.o
In file included from /usr/include/c++/4.2.1/ios:47,
 from /usr/include/c++/4.2.1/ostream:45,
 from /usr/include/c++/4.2.1/iterator:70,
 from boost/boost/next_prior.hpp:15,
 from boost/boost/utility.hpp:17,
 from boost/boost/python/instance_holder.hpp:10,
 from boost/boost/python/object/pointer_holder.hpp:14,
 from boost/boost/python/to_python_indirect.hpp:10,
 from boost/boost/python/converter/arg_to_python.hpp:10,
 from boost/boost/python/call.hpp:15,
 from boost/boost/python/object_core.hpp:14,
 from boost/boost/python/args.hpp:25,
 from boost/boost/python.hpp:11,
 from bend.hh:6,
 from bend.cc:1:
/usr/include/c++/4.2.1/bits/localefwd.h:58:34: error: macro isspace passed 2 
arguments, but takes just 1
/usr/include/c++/4.2.1/bits/localefwd.h:70:34: error: macro isupper passed 2 
arguments, but takes just 1
/usr/include/c++/4.2.1/bits/localefwd.h:74:34: error: macro islower passed 2 
arguments, but takes just 1
/usr/include/c++/4.2.1/bits/localefwd.h:78:34: error: macro isalpha passed 2 
arguments, but takes just 1
/usr/include/c++/4.2.1/bits/localefwd.h:94:34: error: macro isalnum passed 2 
arguments, but takes just 1
/usr/include/c++/4.2.1/bits/localefwd.h:102:34: error: macro toupper passed 2 
arguments, but takes just 1
/usr/include/c++/4.2.1/bits/localefwd.h:106:34: error: macro tolower passed 2 
arguments, but takes just 1
In file included from /usr/include/c++/4.2.1/bits/basic_ios.h:44,
 from /usr/include/c++/4.2.1/ios:50,
 from /usr/include/c++/4.2.1/ostream:45,
 from /usr/include/c++/4.2.1/iterator:70,
 from boost/boost/next_prior.hpp:15,
 from boost/boost/utility.hpp:17,
 from boost/boost/python/instance_holder.hpp:10,
 from boost/boost/python/object/pointer_holder.hpp:14,
 from boost/boost/python/to_python_indirect.hpp:10,
 from boost/boost/python/converter/arg_to_python.hpp:10,
 from boost/boost/python/call.hpp:15,
 from boost/boost/python/object_core.hpp:14,
 from boost/boost/python/args.hpp:25,
 from boost/boost/python.hpp:11,
 from bend.hh:6,
 from bend.cc:1:
/usr/include/c++/4.2.1/bits/locale_facets.h:242:53: error: macro toupper 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:271:53: error: macro tolower 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:814:53: error: macro toupper 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:847:53: error: macro tolower 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:4611:44: error: macro isspace 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:4629:44: error: macro isupper 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:4635:44: error: macro islower 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:4641:44: error: macro isalpha 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:4665:44: error: macro isalnum 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:4677:44: error: macro toupper 
passed 2 arguments, but takes just 1
/usr/include/c++/4.2.1/bits/locale_facets.h:4683:44: error: macro tolower 
passed 2 arguments, but takes just 1
In file included from /usr/include/c++/4.2.1/ios:47,
   

[issue10910] pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation

2011-01-14 Thread Bert JW Regeer

New submission from Bert JW Regeer ber...@regeer.org:

I was recently attempting to get Botan (http://botan.randombit.net) working 
with Python 2.6.6 on FreeBSD when it failed to compile, I filled a bug with 
Botan (http://bugs.randombit.net/show_bug.cgi?id=135) and first thought it was 
a compiler issue, and then thought it might be a Boost.Python issue.

However after further digging, see comment 3 
(http://bugs.randombit.net/show_bug.cgi?id=135#c3) I figured out it had to do 
with the fix that went in to pyport.h for issues with isspace/toupper/et al. on 
FreeBSD's libc and also Mac OS X.

As can be seen in 
http://svn.python.org/view/python/trunk/Include/pyport.h?r1=36519r2=36793 a 
change was added to override the original definitions with a new one that used 
the wide character support. It was modified again in 
http://svn.python.org/view/python/trunk/Include/pyport.h?r1=77585r2=80178 to 
also include Mac OS X for http://bugs.python.org/issue7072.

The issue here is that if this file is included in any C++ code that then also 
includes locale or any of other functions that might pull in localefwd.h the 
defines will cause actual C++ code functions to be overwritten with invalid 
data, and the C++ compiler will throw errors such as:

/usr/include/c++/4.2/bits/localefwd.h:58:34: error: macro isspace passed 2
arguments, but takes just 1

Putting an #if 0, #endif around that block of code allows Botan's python module 
to cleanly compile without issues.

I do apologise that I don't have a simple C++ program that reproduces the 
problem.

--
assignee: ronaldoussoren
components: Build, Extension Modules, Library (Lib), Macintosh, Unicode, ctypes
messages: 126299
nosy: X-Istence, ronaldoussoren
priority: normal
severity: normal
status: open
title: pyport.h FreeBSD/Mac OS X fix causes errors in C++ compilation
type: compile error
versions: Python 2.6, Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com