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

isfinite for msvc #4612

Merged
merged 1 commit into from Apr 17, 2019
Merged

isfinite for msvc #4612

merged 1 commit into from Apr 17, 2019

Conversation

gf712
Copy link
Member

@gf712 gf712 commented Apr 17, 2019

std::isfinite in msvc only accepts floats (otherwise there is an ambiguous call to overloaded function compiler error), so need to use _isfinite from cfloat to implicitly covert non-floats to floats.

// TODO: microsoft should really start supporting c++11
#define IS_FINITE(x) _isfinite(x)
#else
#include <cmath>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vigsterkr this should solve your ruby issue

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise you might have to include header at the top of the swig file, like here

@vigsterkr vigsterkr merged commit 6523887 into shogun-toolbox:develop Apr 17, 2019
@gf712 gf712 deleted the isfinite_fix branch April 17, 2019 19:09
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