Skip to content

Commit ee59723

Browse files
[SYCL] Avoid MSVC's max macro in allocator_traits (#6565)
Compiling aligned_allocator.hpp with MSVC causes a problem as max is defined as a macro. This commit works around this issue. Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com> Co-authored-by: aelovikov-intel <andrei.elovikov@intel.com>
1 parent 0365594 commit ee59723

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sycl/include/sycl/detail/aligned_allocator.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ struct allocator_traits<sycl::detail::aligned_allocator<T>> {
131131
}
132132

133133
static size_type max_size(const allocator_type &) noexcept {
134-
return std::numeric_limits<size_type>::max() / sizeof(value_type);
134+
// max is a macro on Windows...
135+
return (std::numeric_limits<size_type>::max)() / sizeof(value_type);
135136
}
136137

137138
static allocator_type

0 commit comments

Comments
 (0)