Numerous using of std::min without including <algorithm> cause compilation fail on windows
Submitted by Dmytro Morgun
Assigned to poppler-bugs
Description
Poppler (0.33) uses std::min/max while very rarely (if anywhere) including <algorithm>
. Check poppler/Annot.cc or poppler/Array.cc for example.
This causes compilation to fail on windows using msvc (with CMake).
std::min is only guaranteed to be defined if <algorithm>
is included. Looks like <set>
includes <algorithm>
for gcc. But that is not a guaranteed behavior.
I've workaround it adding
extern "C++"
{
#include <algorithm>
}
to the poppler-config.h but that is hardly a good solution.