-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guard against usage of _isatty when header was not included #3880
Conversation
I would prefer an auto-detection in the header instead of the build tools something along the lines of
This would necessitate the inclusion of the windows SDK header, which might be unwanted? I see that the windows header for For the naming I would propose edit: here is the link with the winapi guards for |
No, the flag was actually for Windows 98 support. I had no idea that it'd also be useful for some modern Windows variants. I don't think
That's not what this flag actually is. If you really want to rename it, perhaps |
Thanks for clarifying the original intent. So there are overlapping but distinct motivations. |
Adding windows includes to |
For me, and I assume others using these modern platforms, this fine enough. I will rename the macro in this PR if there is no further disagreement on |
Thank you! |
The recent addition of the
FMT_WINDOWS_NO_WCHAR
flag tried to enable builds for Windows platforms that are notWINAPI_FAMILY_DESKTOP_APP
as per the WINAPI family.The inclusion of
<io.h>
became conditional onFMT_WINDOWS_NO_WCHAR
. The usage of_isatty
from that header however was not guarded. This PR tries to fix this.There are two followup points for discussion:
FMT_WINDOWS_NO_WCHAR
is incredibly misleading since it has nothing to do with wchar support but with the availability of the console output functionWriteConsoleW
only onWINAPI_FAMILY_DESKTOP_APP
platforms. Should that macro be renamed?FMT_WINDOWS_NO_WCHAR
could be auto-detected by querying theWINAPI_FAMILY
macros provided by the Windows header. Should this be included informat.h
with the other config detection?