Skip to content

Commit

Permalink
Issue python#10910: Avoid C++ compilation errors on FreeBSD and OS X.
Browse files Browse the repository at this point in the history
Patch by Ronald Oussoren.
  • Loading branch information
ned-deily committed Aug 15, 2016
1 parent 80a3ba9 commit 7659aab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Include/pyport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <locale> defines these symbols as real functions,
* with a slightly different signature.
* See issue #10910
*/
#include <ctype.h>
#include <wctype.h>
#undef isalnum
Expand All @@ -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.
Expand Down

0 comments on commit 7659aab

Please sign in to comment.