We need to #define NOMINMAX before including windows.h.
Can you apply this patch and see how many other places need an update as well (same diff should fix it, right at the top of the main .cxx file bing compiled before the first #include).
diff --git i/IO/Core/vtkResourceStream.cxx w/IO/Core/vtkResourceStream.cxx
index 4790d63f03..c9c6e9535d 100644
--- i/IO/Core/vtkResourceStream.cxx
+++ w/IO/Core/vtkResourceStream.cxx
@@ -1,5 +1,11 @@
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause
+
+#ifdef _WIN32
+// Disable min/max macros from `windows.h`.
+#define NOMINMAX
+#endif
+
#include "vtkResourceStream.h"
#include <algorithm>
your code does not fix the error. This error is not about min/max macros.
std::min is a template and requies both its params to be of the same type. On x86
std::copy_n(parent_type::gptr(), (std::min)(available, count), str);
available is std::ptrdiff_t == int == 4 bytes (on x86, 8 bytes on x64)
count is std::streamsize == long long == 8 bytes