Build: avoid win32-incompatible functions #2019

Merged
merged 1 commit into from May 17, 2013

Conversation

Projects
None yet
2 participants
@GBillotey
Contributor

GBillotey commented May 16, 2013

Dating from commit e1e0848, I have been experimenting compiling errors (under win32).

c:\users\geoffroy\documents\github\matplotlib\src\path_converters.h(895) : error C3861: 'seed48': identifier not found
        c:\users\geoffroy\documents\github\matplotlib\src\path_converters.h(893) : while compiling class template member function 'void Sketch<VertexSource>::rewind(unsigned int)'
        with
        [
            VertexSource=curve_t
        ]
        src/_path.cpp(1516) : see reference to class template instantiation 'Sketch<VertexSource>' being compiled
        with
        [
            VertexSource=curve_t
        ]

They seem to be linked with the use of traditional UNIX functions like drand48 in path_converters.h. seed48 and M_PI are also problematic.

Enclosed is a patch attempt which uses ANSI C function rand and srand instead, and at least compile correctly - with win SDK. (The code being quite complex I can't be sure with my limited C++ knowledge this is the best way to deal with it ; hope it can help though)

@mdboom

This comment has been minimized.

Show comment Hide comment
@mdboom

mdboom May 17, 2013

Owner

Indeed. I should have been more careful about sticking to ANSI C. Thanks for the PR.

Owner

mdboom commented May 17, 2013

Indeed. I should have been more careful about sticking to ANSI C. Thanks for the PR.

mdboom added a commit that referenced this pull request May 17, 2013

Merge pull request #2019 from GBillotey/SDK_build
Build: avoid win32-incompatible functions

@mdboom mdboom merged commit f311ef5 into matplotlib:master May 17, 2013

1 check passed

default The Travis CI build passed
Details

@GBillotey GBillotey deleted the GBillotey:SDK_build branch May 18, 2013

@GBillotey

This comment has been minimized.

Show comment Hide comment
@GBillotey

GBillotey May 18, 2013

Contributor

Thanks for the merge.

While having a last read:
shouldn't I have used doubles instead of floats for _drand and _M_PI ? If you confirm, I would be happy to do the short corrective PR (sorry, I should have paid more attention in the first place).

Contributor

GBillotey commented May 18, 2013

Thanks for the merge.

While having a last read:
shouldn't I have used doubles instead of floats for _drand and _M_PI ? If you confirm, I would be happy to do the short corrective PR (sorry, I should have paid more attention in the first place).

@mdboom

This comment has been minimized.

Show comment Hide comment
@mdboom

mdboom May 20, 2013

Owner

Indeed. Thanks for catching that. Practically speaking, I don't think it much matters on images of reasonably normal size. However, we should probably be consistent with doubles everywhere (since that's what's used for vertices in general).

Owner

mdboom commented May 20, 2013

Indeed. Thanks for catching that. Practically speaking, I don't think it much matters on images of reasonably normal size. However, we should probably be consistent with doubles everywhere (since that's what's used for vertices in general).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment