X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=blobdiff_plain;f=folly%2Fportability%2FWindows.h;h=7ccfde8c01a99eafd109ff4ef9d574d6851291bf;hp=2cb0bda86769d89cfbf9c35457635ba66394348c;hb=887367cae9e579cd1b715265a4f1b089beda71da;hpb=c32f067bded198c6e907ee31ed76d83baa856a8e diff --git a/folly/portability/Windows.h b/folly/portability/Windows.h index 2cb0bda8..7ccfde8c 100755 --- a/folly/portability/Windows.h +++ b/folly/portability/Windows.h @@ -37,6 +37,18 @@ #include // nolint #endif +#if defined(min) || defined(max) +#error Windows.h needs to be included by this header, or else NOMINMAX needs \ + to be defined before including it yourself. +#endif + +// This is needed because, for some absurd reason, one of the windows headers +// tries to define "min" and "max" as macros, which messes up most uses of +// std::numeric_limits. +#ifndef NOMINMAX +#define NOMINMAX 1 +#endif + #include #include