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

Skip to content

Commit 7659aab

Browse files
committed
Issue #10910: Avoid C++ compilation errors on FreeBSD and OS X.
Patch by Ronald Oussoren.
1 parent 80a3ba9 commit 7659aab

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Include/pyport.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,12 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
688688
#endif
689689

690690
#ifdef _PY_PORT_CTYPE_UTF8_ISSUE
691+
#ifndef __cplusplus
692+
/* The workaround below is unsafe in C++ because
693+
* the <locale> defines these symbols as real functions,
694+
* with a slightly different signature.
695+
* See issue #10910
696+
*/
691697
#include <ctype.h>
692698
#include <wctype.h>
693699
#undef isalnum
@@ -705,6 +711,7 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
705711
#undef toupper
706712
#define toupper(c) towupper(btowc(c))
707713
#endif
714+
#endif
708715

709716

710717
/* Declarations for symbol visibility.

0 commit comments

Comments
 (0)