Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: avoid win32-incompatible functions #2019

Merged
merged 1 commit into from May 17, 2013
Merged

Build: avoid win32-incompatible functions #2019

merged 1 commit into from May 17, 2013

Conversation

GBillotey
Copy link
Contributor

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
Copy link
Member

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
Build: avoid win32-incompatible functions
@mdboom mdboom merged commit f311ef5 into matplotlib:master May 17, 2013
@GBillotey GBillotey deleted the SDK_build branch May 18, 2013 08:02
@GBillotey
Copy link
Contributor Author

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
Copy link
Member

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants