Avoid windows issue with min() max() macros

Including the ``windows.h`` file without defining ``NOMINMAX`` will define the `min()` and `max()` macros which will result in issues compiling any C++ code that uses any variant of `max`, for example `std::numeric_limits<std::streamsize>::max()` and many others.  Although max() isn't used in Fmt anywhere, it is often used in codes that include a format include file so simply upgrading to the current version of lib::fmt will break the windows build which worked prior to the update...
This commit is contained in:
Greg Sjaardema 2020-04-06 10:38:07 -06:00 committed by Victor Zverovich
parent 27e3c0fe9b
commit 34b3f7b7aa

View File

@ -22,8 +22,14 @@
#endif
#ifdef _WIN32
# include <io.h>
# if defined(NOMINMAX)
# include <windows.h>
# else
# define NOMINMAX
# include <windows.h>
# undef NOMINMAX
# endif
# include <io.h>
#endif
#ifdef _MSC_VER