mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 17:58:35 +08:00
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:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user