diff --git a/include/realtime_tools/realtime_helpers.hpp b/include/realtime_tools/realtime_helpers.hpp index ef486a49..3a631976 100644 --- a/include/realtime_tools/realtime_helpers.hpp +++ b/include/realtime_tools/realtime_helpers.hpp @@ -35,8 +35,11 @@ #include #ifdef _WIN32 -#include -using NATIVE_THREAD_HANDLE = HANDLE; +// Here we directly use void* instead of including windows.h +// and using HANDLE macro to avoid polluting all the downstream +// compilation units that include the public header realtime_helpers.hpp +// with problematic macros like MIN, MAX or ERROR +using NATIVE_THREAD_HANDLE = void *; #else using NATIVE_THREAD_HANDLE = pthread_t; #endif diff --git a/src/realtime_helpers.cpp b/src/realtime_helpers.cpp index e55894ce..bbabf0bc 100644 --- a/src/realtime_helpers.cpp +++ b/src/realtime_helpers.cpp @@ -28,7 +28,9 @@ #include "realtime_tools/realtime_helpers.hpp" -#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) +#ifdef _WIN32 +#include +#else #include #include #include