From 7659aab5e990dd33fab47bd29c445ed7202e0cac Mon Sep 17 00:00:00 2001 From: Ned Deily Date: Mon, 15 Aug 2016 03:07:26 -0400 Subject: [PATCH 1/2] Issue #10910: Avoid C++ compilation errors on FreeBSD and OS X. Patch by Ronald Oussoren. --- Include/pyport.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Include/pyport.h b/Include/pyport.h index 66e00d4e6dd..3bab84d690a 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -688,6 +688,12 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *); #endif #ifdef _PY_PORT_CTYPE_UTF8_ISSUE +#ifndef __cplusplus + /* The workaround below is unsafe in C++ because + * the defines these symbols as real functions, + * with a slightly different signature. + * See issue #10910 + */ #include #include #undef isalnum @@ -705,6 +711,7 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *); #undef toupper #define toupper(c) towupper(btowc(c)) #endif +#endif /* Declarations for symbol visibility. From 3d4559936a0e628c1c910c48b26907f2b2f2c9cb Mon Sep 17 00:00:00 2001 From: Ned Deily Date: Mon, 15 Aug 2016 03:08:18 -0400 Subject: [PATCH 2/2] Issue #10910: Update FreedBSD version checks for the ctype UTF-8 workaround. The original problem has been fixed in newer versions of FreeBSD. Patch by Dimitry Andric of the FreeBSD project. --- Include/pyport.h | 4 +++- Misc/NEWS | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Include/pyport.h b/Include/pyport.h index 3bab84d690a..ba49221b8e2 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -677,7 +677,9 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *); #ifdef __FreeBSD__ #include -#if __FreeBSD_version > 500039 +#if (__FreeBSD_version >= 500040 && __FreeBSD_version < 602113) || \ + (__FreeBSD_version >= 700000 && __FreeBSD_version < 700054) || \ + (__FreeBSD_version >= 800000 && __FreeBSD_version < 800001) # define _PY_PORT_CTYPE_UTF8_ISSUE #endif #endif diff --git a/Misc/NEWS b/Misc/NEWS index 4c6ca30d260..d91678005bc 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -175,6 +175,10 @@ Build - Issue #26662: Set PYTHON_FOR_GEN in configure as the Python program to be used for file generation during the build. +- Issue #10910: Avoid C++ compilation errors on FreeBSD and OS X. + Also update FreedBSD version checks for the original ctype UTF-8 workaround. + + What's New in Python 3.5.2? ===========================