Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6349612

Browse files
committed
Issue #10910: merge from 3.5
2 parents 15f3228 + 3d45599 commit 6349612

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

Include/pyport.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,9 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
677677

678678
#ifdef __FreeBSD__
679679
#include <osreldate.h>
680-
#if __FreeBSD_version > 500039
680+
#if (__FreeBSD_version >= 500040 && __FreeBSD_version < 602113) || \
681+
(__FreeBSD_version >= 700000 && __FreeBSD_version < 700054) || \
682+
(__FreeBSD_version >= 800000 && __FreeBSD_version < 800001)
681683
# define _PY_PORT_CTYPE_UTF8_ISSUE
682684
#endif
683685
#endif
@@ -688,6 +690,12 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
688690
#endif
689691

690692
#ifdef _PY_PORT_CTYPE_UTF8_ISSUE
693+
#ifndef __cplusplus
694+
/* The workaround below is unsafe in C++ because
695+
* the <locale> defines these symbols as real functions,
696+
* with a slightly different signature.
697+
* See issue #10910
698+
*/
691699
#include <ctype.h>
692700
#include <wctype.h>
693701
#undef isalnum
@@ -705,6 +713,7 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
705713
#undef toupper
706714
#define toupper(c) towupper(btowc(c))
707715
#endif
716+
#endif
708717

709718

710719
/* Declarations for symbol visibility.

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ Build
165165
- Issue #26662: Set PYTHON_FOR_GEN in configure as the Python program to be
166166
used for file generation during the build.
167167

168+
- Issue #10910: Avoid C++ compilation errors on FreeBSD and OS X.
169+
Also update FreedBSD version checks for the original ctype UTF-8 workaround.
170+
171+
168172
What's New in Python 3.6.0 alpha 3
169173
==================================
170174

0 commit comments

Comments
 (0)