[flang][msvc] Tell windows.h to not define min/max macros.
authorMichael Kruse <llvm-project@meinersbur.de>
Wed, 12 Aug 2020 19:21:30 +0000 (14:21 -0500)
committerMichael Kruse <llvm-project@meinersbur.de>
Wed, 12 Aug 2020 19:36:21 +0000 (14:36 -0500)
commite3d38b7b88989835d11b9d134482c17655b5a65d
tree3bf31f88beb10373741e32f4846e71529292b12d
parent269bc3f5df6c3b75de515a48063c6941ef8fbbe6
[flang][msvc] Tell windows.h to not define min/max macros.

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 [[ http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html | make flang compilable with MS Visual Studio ]].

Reviewed By: isuruf

Differential Revision: https://reviews.llvm.org/D85656
flang/runtime/file.cpp