Skip to content

Commit

Permalink
Add NOMINMAX before windows.h in enumerable_thread_specific.h (#1291)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Alexandr-Konovalov authored Jan 22, 2024
1 parent 4dfcb6d commit 54a22a6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion include/oneapi/tbb/enumerable_thread_specific.h
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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 <windows.h>
#if __TBB_DEFINED_NOMINMAX
#undef NOMINMAX
#undef __TBB_DEFINED_NOMINMAX
#endif
#else
#include <pthread.h>
#endif
Expand Down

0 comments on commit 54a22a6

Please sign in to comment.