Fix for issue #7072
diff --git a/Include/pyport.h b/Include/pyport.h
index a6ddbee..e02a5fd 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -666,6 +666,16 @@
 #ifdef __FreeBSD__
 #include <osreldate.h>
 #if __FreeBSD_version > 500039
+# define _PY_PORT_CTYPE_UTF8_ISSUE
+#endif
+#endif
+
+
+#if defined(__APPLE__)
+# define _PY_PORT_CTYPE_UTF8_ISSUE
+#endif
+
+#ifdef _PY_PORT_CTYPE_UTF8_ISSUE
 #include <ctype.h>
 #include <wctype.h>
 #undef isalnum
@@ -683,7 +693,6 @@
 #undef toupper
 #define toupper(c) towupper(btowc(c))
 #endif
-#endif
 
 
 /* Declarations for symbol visibility.