diff --git a/viewer/JFJochHttpReader.cpp b/viewer/JFJochHttpReader.cpp index 7103ad5e..8f15f1c4 100644 --- a/viewer/JFJochHttpReader.cpp +++ b/viewer/JFJochHttpReader.cpp @@ -3,7 +3,6 @@ #include "JFJochHttpReader.h" -#include #include #include #include @@ -15,6 +14,10 @@ #include "../common/JFJochMath.h" #include "../image_analysis/bragg_integration/CalcISigma.h" +// Included last, after all std/project headers: on Windows pulls in , +// whose min/max (and other) macros must not precede the headers that use std::min / std::max. +#include + namespace { // libcurl write callback: append the received bytes to a std::string (which holds binary fine). size_t AppendToString(char *ptr, size_t size, size_t nmemb, void *userdata) { diff --git a/viewer/JFJochHttpReader.h b/viewer/JFJochHttpReader.h index 3dbbd122..d973dc4c 100644 --- a/viewer/JFJochHttpReader.h +++ b/viewer/JFJochHttpReader.h @@ -3,13 +3,18 @@ #pragma once -#include - #include "../reader/JFJochReader.h" #include "../common/BrokerStatus.h" #include "../common/ImageBuffer.h" #include "../common/ROIDefinition.h" +// libcurl's easy handle, kept opaque here so this widely-included header does NOT pull in +// . On Windows curl.h drags in , whose min/max/ERROR/LoadImage macros +// would then clobber every viewer translation unit that includes this header (breaking std::min / +// std::max in gemmi, the `ERROR` enum, the LoadImage() calls, ...). CURL is `typedef void` in +// libcurl; is included only in JFJochHttpReader.cpp. +using CURL = void; + class JFJochHttpReader : public JFJochReader { mutable std::mutex http_mutex; std::string addr;