diff --git a/src/ray/util/logging.h b/src/ray/util/logging.h index d61598260..da5cd5f25 100644 --- a/src/ray/util/logging.h +++ b/src/ray/util/logging.h @@ -4,6 +4,21 @@ #include #include +#if defined(_WIN32) +#ifndef _WINDOWS_ +#ifndef WIN32_LEAN_AND_MEAN // Sorry for the inconvenience. Please include any related + // headers you need manually. + // (https://stackoverflow.com/a/8294669) +#define WIN32_LEAN_AND_MEAN // Prevent inclusion of WinSock2.h +#endif +#include // Force inclusion of WinGDI here to resolve name conflict +#endif +#ifdef ERROR // Should be true unless someone else undef'd it already +#undef ERROR // Windows GDI defines this macro; make it a global enum so it doesn't + // conflict with our code +enum { ERROR = 0 }; +#endif +#endif namespace ray { enum class RayLogLevel { DEBUG = -1, INFO = 0, WARNING = 1, ERROR = 2, FATAL = 3 };