Bug 91060 - Numerous using of std::min without including <algorithm> cause compilation fail on windows
Summary: Numerous using of std::min without including <algorithm> cause compilation fa...
Status: RESOLVED MOVED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-22 15:12 UTC by Dmytro Morgun
Modified: 2018-08-21 10:33 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Dmytro Morgun 2015-06-22 15:12:55 UTC
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.
Comment 1 Albert Astals Cid 2015-06-30 22:26:31 UTC
Right, this is not a good solution, so please attach a patch that adds the proper includes you need to build.
Comment 2 Dmytro Morgun 2015-07-02 10:46:43 UTC
Uhm, seems like it happened before and there was a less lazy guy then me, so here's some patch (sorry, haven't tried that yet).

https://bugs.freedesktop.org/attachment.cgi?id=112382

via

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

Maybe I'll see to it later...
Comment 3 GitLab Migration User 2018-08-21 10:33:46 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/260.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.