Skip to content

json_writer: improve isfinite support on *nix #371

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

Merged

Conversation

mathstuf
Copy link
Contributor

@mathstuf mathstuf commented Oct 1, 2015

Based on a patches to CMake by:

Ådne Hovda [email protected]:

commit 7b1cdb00279908cacabada92f8a53e4986465423

jsoncpp: Provide 'isfinite' implementation on older AIX and HP-UX

Newer AIX and HP-UX platforms provide 'isfinite' as a <math.h> macro.
Older versions do not, so add the definition if it is not provided.

Michael Scott [email protected]:

commit 9217b678b305d7df7471ba476a81bf28961fdfa3

jsoncpp: Provide 'isfinite' impl on more HP-UX versions (#15576)

Some versions of HP-UX do not define 'isfinite' or 'finite' in math.h
for Itanium when preprocessing with C++, so we have to add the
definition ourselves instead to map to the internal version.

Joerg Sonnenberger [email protected]:

commit 75644dafe54c21902f14cfe58cb8338b553b69d8

jsoncpp: Fix compilation as C99 on Solaris

In C99 mode, Solaris variants may already define isfinite, so check for
the existence first.

Based on a patches to CMake by:

Ådne Hovda <[email protected]>:

    commit 7b1cdb00279908cacabada92f8a53e4986465423

    jsoncpp: Provide 'isfinite' implementation on older AIX and HP-UX

    Newer AIX and HP-UX platforms provide 'isfinite' as a <math.h> macro.
    Older versions do not, so add the definition if it is not provided.

Michael Scott <[email protected]>:

    commit 9217b678b305d7df7471ba476a81bf28961fdfa3

    jsoncpp: Provide 'isfinite' impl on more HP-UX versions (#15576)

    Some versions of HP-UX do not define 'isfinite' or 'finite' in math.h
    for Itanium when preprocessing with C++, so we have to add the
    definition ourselves instead to map to the internal version.

Joerg Sonnenberger <[email protected]>:

    commit 75644dafe54c21902f14cfe58cb8338b553b69d8

    jsoncpp: Fix compilation as C99 on Solaris

    In C99 mode, Solaris variants may already define isfinite, so check for
    the existence first.
@mathstuf
Copy link
Contributor Author

mathstuf commented Oct 1, 2015

@bradking

@mathstuf
Copy link
Contributor Author

mathstuf commented Oct 1, 2015

Links to the cmake commits: Kitware/CMake@7b1cdb0 Kitware/CMake@9217b67 Kitware/CMake@75644da.

If you'd like these split as they came into CMake, let me know and I'll redo the branch.

@cdunn2001
Copy link
Contributor

Wow. So much work for a value that is not even part of standard JSON.

Anyway, thanks! Looks good to me. One question: Can <math.h> be <cmath> on those platforms? Some compilers will warn about non-standard includes. It's not a huge problem. Just asking.

@mathstuf
Copy link
Contributor Author

mathstuf commented Oct 1, 2015

Yeah, math.h is a fun bit of the standard-meets-reality story. As for headers, I don't know :( . Brad?

@bradking
Copy link
Contributor

bradking commented Oct 2, 2015

CMake's last import of jsoncpp pre-dates the change from math.h to cmath, and cmath is not included anywhere in the entire CMake source tree, so I don't know whether cmath would work on those platforms. As mentioned in the commit message proposed here, the changes to CMake were all contributed by others. I don't have access to all their platforms to try it out myself. Fortunately it is only on AIX and HP-UX that math.h is included by this patch. After we next update CMake's jsoncpp version we may be able to test out cmath for this use case.

cdunn2001 added a commit that referenced this pull request Oct 3, 2015
json_writer: improve isfinite support on *nix
@cdunn2001 cdunn2001 merged commit 49393ea into open-source-parsers:master Oct 3, 2015
@mathstuf mathstuf deleted the more-platform-support branch October 7, 2015 02:36
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.

3 participants