Modify RayLogLevel to avoid conflicts with DEBUG macro and ERROR macros that are defined externally (#6204)

* Prevent name collision of ERROR macro from Windows with RayLogLevel::ERROR
This commit is contained in:
mehrdadn
2019-11-25 16:02:26 -08:00
committed by Edward Oakes
parent ca08a8f479
commit ed5154d7fe
+15
View File
@@ -4,6 +4,21 @@
#include <iostream>
#include <string>
#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 <Windows.h> // 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 };