This is an archive of the discontinued LLVM Phabricator instance.

[flang][msvc] Tell windows.h to not define min/max macros.
ClosedPublic

Authored by Meinersbur on Aug 10 2020, 8:20 AM.

Details

Summary

Defining macros for min and max breaks using std::min and std::max. Defining NOMINMAX before including the header stops them from being defined.

See https://web.archive.org/web/20170911092732/https://support.microsoft.com/en-us/help/143208/prb-using-stl-in-windows-program-can-cause-min-max-conflicts for details.

This patch is part of the series to make flang compilable with MS Visual Studio.

Diff Detail

Event Timeline

Meinersbur created this revision.Aug 10 2020, 8:20 AM
Herald added a project: Restricted Project. · View Herald Transcript
Meinersbur requested review of this revision.Aug 10 2020, 8:20 AM
Meinersbur retitled this revision from [flang][msvc] Teach windows.h not to define min/max macros. to [flang][msvc] Tell windows.h to not define min/max macros..
isuruf accepted this revision.Aug 10 2020, 9:45 AM
This revision is now accepted and ready to land.Aug 10 2020, 9:45 AM
This revision was landed with ongoing or failed builds.Aug 12 2020, 12:36 PM
This revision was automatically updated to reflect the committed changes.