Skip to content

Commit

Permalink
[Python] Use std::isfinite() under C++11
Browse files Browse the repository at this point in the history
  • Loading branch information
ojwb committed Mar 1, 2016
1 parent 5733cc1 commit 75510a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Lib/typemaps/fragments.swg
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,11 @@
%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. */
#ifndef SWIG_isfinite
/* isfinite() is a macro for C99, but a function for C++11. */
# if defined(isfinite) || (defined __cplusplus && __cplusplus >= 201103L)
/* isfinite() is a macro for C99, but a function in namespace std for C++11. */
# if defined(isfinite)
# define SWIG_isfinite(X) (isfinite(X))
# elif defined __cplusplus && __cplusplus >= 201103L
# define SWIG_isfinite(X) (std::isfinite(X))
# elif defined(_MSC_VER)
# define SWIG_isfinite(X) (_finite(X))
# elif defined(__sun) && defined(__SVR4)
Expand Down

0 comments on commit 75510a1

Please sign in to comment.