Based on one of the answers above "Xcode 16 appears to have changed the header search behavior." I asked chatGPT:
Yes, Xcode 16 has indeed introduced changes in how it handles header search paths, and this might be the root cause of the issues you’re seeing with undeclared identifiers such as _CTYPE_A in headers like ___wctype.h. These changes can affect projects that depend on third-party libraries or custom SDK setups, especially if they modify search paths or include files in a non-standard way.
Go to your project’s Build Settings.
Look for Header Search Paths and ensure they are set up correctly.
• You may need to change from recursive to non-recursive to prevent unintended overrides.
• Consider moving system paths like /usr/include or /Applications/Xcode.app/Contents/Developer above any custom or third-party paths.
• Try adjusting the order of the search paths to ensure that system headers take precedence over any third-party or user-defined paths.
I was able to resolve this under Build Settings by changing a custom path I have set for Header Search Paths, from recursive to non-recursive.