[Poppler-bugs] [Bug 91060] New: Numerous using of std::min without including <algorithm> cause compilation fail on windows

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jun 22 08:12:55 PDT 2015


https://bugs.freedesktop.org/show_bug.cgi?id=91060

            Bug ID: 91060
           Summary: Numerous using of std::min without including
                    <algorithm> cause compilation fail on windows
           Product: poppler
           Version: unspecified
          Hardware: x86 (IA32)
                OS: Windows (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
          Assignee: poppler-bugs at lists.freedesktop.org
          Reporter: lztoad at gmail.com

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20150622/77635572/attachment-0001.html>


More information about the Poppler-bugs mailing list