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:
parent
27e3c0fe9b
commit
34b3f7b7aa
@ -22,8 +22,14 @@
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# if defined(NOMINMAX)
|
||||
# include <windows.h>
|
||||
# else
|
||||
# define NOMINMAX
|
||||
# include <windows.h>
|
||||
# undef NOMINMAX
|
||||
# endif
|
||||
# include <io.h>
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
Loading…
Reference in New Issue
Block a user