From 069715f7711d274f06fd3ecbd07d7633b4dcf76c Mon Sep 17 00:00:00 2001 From: Alexandr Konovalov Date: Thu, 11 Jan 2024 10:36:34 +0100 Subject: [PATCH] Add NOMINMAX before windows.h in enumerable_thread_specific.h Currently enumerable_thread_specific.h inclusion breaks std::min and std::max usage due to macro spreading from windows.h. Signed-off-by: Alexandr Konovalov --- include/oneapi/tbb/enumerable_thread_specific.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/oneapi/tbb/enumerable_thread_specific.h b/include/oneapi/tbb/enumerable_thread_specific.h index 34bcab6821..caa53fa0d6 100644 --- a/include/oneapi/tbb/enumerable_thread_specific.h +++ b/include/oneapi/tbb/enumerable_thread_specific.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2005-2022 Intel Corporation + Copyright (c) 2005-2024 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -36,7 +36,15 @@ #include "task.h" // for task::suspend_point #if _WIN32 || _WIN64 +#ifndef NOMINMAX +#define NOMINMAX +#define __TBB_DEFINED_NOMINMAX 1 +#endif #include +#if __TBB_DEFINED_NOMINMAX +#undef NOMINMAX +#undef __TBB_DEFINED_NOMINMAX +#endif #else #include #endif