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

Remove use of Boost.Math, to avoid the dependency cycle #37

Merged
merged 5 commits into from
Dec 15, 2020

Conversation

pdimov
Copy link
Member

@pdimov pdimov commented Nov 22, 2020

This patch replaces the use of isnan, changesign, signbit, isinf from Boost.Math with <math.h>. I've tested it locally on Windows under msvc-8.0, msvc-10.0, msvc-11.0, msvc-12.0, msvc-14.0, msvc-14.1, clang-win, gcc (cygwin). Of these, it breaks msvc-8.0, 10.0, 11.0, because they don't have the functions in <math.h>, and introduces no new failures on the rest.

Experiments on Godbolt suggest that all Linux gcc versions starting from 4.1 (earliest on Godbolt) have these functions. E.g. https://godbolt.org/z/WTMGr9

Linux Clang, starting from 3.0 (earliest on Godbolt), also seems to work: https://godbolt.org/z/nr1Tvo

What hasn't been tested: Apple Clang, any version.

@pdimov
Copy link
Member Author

pdimov commented Nov 22, 2020

Added emulation math functions for msvc-11.0 and below in a separate commit. With this additional change, msvc-8.0/10.0/11.0 are now unbroken (have no more failures than before.)

@pdimov
Copy link
Member Author

pdimov commented Nov 23, 2020

It's not so easy, as it turns out.

@pdimov
Copy link
Member Author

pdimov commented Nov 23, 2020

OK, now tested on Travis. The results of the current develop branch, as a baseline, are here: https://travis-ci.com/github/pdimov/lexical_cast/builds/203465518

And the results with this PR applied are here: https://travis-ci.com/github/pdimov/lexical_cast/builds/203465561

As far as I can see, it doesn't introduce any new errors. The macOS and clang-ubsan failures are preexistent. They should probably be cleaned up, but that's a separate exercise.

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