Commit f1b466b
fix(PythonQtPythonInclude): conditionally #undef ctype macros only on macOS C++ builds
CPython’s `pyport.h` defines `_PY_PORT_CTYPE_UTF8_ISSUE` on macOS to work
around BSD libc ctype behavior in UTF-8 locales. Those ctype names can
surface as macros and collide with libstdc++’s `<locale>` templated
overloads (e.g., `std::isspace`), leading to compilation errors.
Previously we unconditionally `#undef`’d several ctype macros. Restrict
this to the affected environment by guarding with
`_PY_PORT_CTYPE_UTF8_ISSUE` and `__cplusplus`. This keeps macOS C++ builds
healthy while avoiding unnecessary macro tampering elsewhere.
Adapted from Kitware/VTK@a4fa448099 ("Remove the toupper macro defined by
Python.h.", 2015-11-12).1 parent e3b4859 commit f1b466b
1 file changed
+6
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
159 | 150 | | |
160 | 151 | | |
161 | 152 | | |
162 | 153 | | |
163 | 154 | | |
164 | 155 | | |
165 | 156 | | |
| 157 | + | |
166 | 158 | | |
167 | 159 | | |
168 | 160 | | |
0 commit comments