[Python] Use std::isfinite() under C++11
Follow-up fix for https://github.com/swig/swigissues/615
This commit is contained in:
parent
5733cc1d2a
commit
75510a121d
1 changed files with 4 additions and 2 deletions
|
|
@ -168,9 +168,11 @@
|
||||||
%fragment("SWIG_isfinite","header",fragment="<math.h>,<float.h>") %{
|
%fragment("SWIG_isfinite","header",fragment="<math.h>,<float.h>") %{
|
||||||
/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */
|
/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */
|
||||||
#ifndef SWIG_isfinite
|
#ifndef SWIG_isfinite
|
||||||
/* isfinite() is a macro for C99, but a function for C++11. */
|
/* isfinite() is a macro for C99, but a function in namespace std for C++11. */
|
||||||
# if defined(isfinite) || (defined __cplusplus && __cplusplus >= 201103L)
|
# if defined(isfinite)
|
||||||
# define SWIG_isfinite(X) (isfinite(X))
|
# define SWIG_isfinite(X) (isfinite(X))
|
||||||
|
# elif defined __cplusplus && __cplusplus >= 201103L
|
||||||
|
# define SWIG_isfinite(X) (std::isfinite(X))
|
||||||
# elif defined(_MSC_VER)
|
# elif defined(_MSC_VER)
|
||||||
# define SWIG_isfinite(X) (_finite(X))
|
# define SWIG_isfinite(X) (_finite(X))
|
||||||
# elif defined(__sun) && defined(__SVR4)
|
# elif defined(__sun) && defined(__SVR4)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue