This is an archive of the discontinued LLVM Phabricator instance.

[flang] [runtime] Fix build warnings if built with mingw
ClosedPublic

Authored by mstorsjo on Aug 23 2022, 8:51 AM.

Details

Summary

Check whether F_OK et al are defined before redefining them; mingw
headers do define them, so check before providing the windows fallback
defines.

Also check _WIN32 instead of WIN32; this is how it's consistently
done in the rest of llvm. (The former is a compiler builtin define,
while the latter isn't, but it's commonly set by e.g. build systems.)

Diff Detail

Event Timeline

mstorsjo created this revision.Aug 23 2022, 8:51 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 23 2022, 8:51 AM
mstorsjo requested review of this revision.Aug 23 2022, 8:51 AM

I'm not sure how much my review is worth. But this change looks good to me. 👍

awarzynski accepted this revision.Aug 24 2022, 3:08 AM

This is not my area of expertise, but it looks fairly straightforward and makes sense to me. Thanks, LGTM!

This revision is now accepted and ready to land.Aug 24 2022, 3:08 AM
This revision was automatically updated to reflect the committed changes.