diff --git a/include/cmetrics/cmt_compat.h b/include/cmetrics/cmt_compat.h index 004c0aa..9fc90a3 100644 --- a/include/cmetrics/cmt_compat.h +++ b/include/cmetrics/cmt_compat.h @@ -22,7 +22,13 @@ #include #ifdef _WIN32 +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN #include +#undef WIN32_LEAN_AND_MEAN +#else +#include +#endif #endif static inline struct tm *cmt_platform_gmtime_r(const time_t *timep, struct tm *result) diff --git a/src/cmt_atomic_msvc.c b/src/cmt_atomic_msvc.c index 3fd66db..3da37a7 100644 --- a/src/cmt_atomic_msvc.c +++ b/src/cmt_atomic_msvc.c @@ -18,7 +18,13 @@ */ #include +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN #include +#undef WIN32_LEAN_AND_MEAN +#else +#include +#endif /* This allows cmt_atomic_initialize to be automatically called * as soon as the program starts if enabled.