Menu

#39 isinf and isnan causing build failure on solaris

open
nobody
None
5
2007-10-04
2007-10-04
No

Build fails on solaris because isnan and isinf aren't found. I ran into this problem before and fixed it in the makefile by adding -D__C99FEATURES__. The switch to autoconf got rid of that fix.

We can solve the problem the same way as a decent temporary solution. In the long run, it has been suggested to me a good solution would be to add isnan and isinf to gnulib and use that.

Discussion

  • Richard Uhler

    Richard Uhler - 2007-10-04

    Logged In: YES
    user_id=1884147
    Originator: YES

    Adding -D__C99FEATURES__ didn't fix the problem, so I guess it's not a decent temporary solution.

     
  • Richard Uhler

    Richard Uhler - 2007-10-05

    Logged In: YES
    user_id=1884147
    Originator: YES

    Adding the following, taken from the autoconf manual, fixed the isnan and isinf problems:

    #ifndef isnan
    # define isnan(x) \
    (sizeof (x) == sizeof (long double) ? isnan_ld (x) \
    sizeof (x) == sizeof (double) ? isnan_d (x) \
    isnan_f (x))
    static inline int isnan_f (float x) { return x != x; }
    static inline int isnan_d (double x) { return x != x; }
    static inline int isnan_ld (long double x) { return x != x; }
    #endif
    #ifndef isinf
    # define isinf(x) \
    (sizeof (x) == sizeof (long double) ? isinf_ld (x) \
    sizeof (x) == sizeof (double) ? isinf_d (x) \
    isinf_f (x))
    static inline int isinf_f (float x) { return isnan (x - x); }
    static inline int isinf_d (double x) { return isnan (x - x); }
    static inline int isinf_ld (long double x) { return isnan (x - x); }
    #endif

    Though admittedly, I didn't manage to run them and see if they worked.

    The ideal solution would be add this to gnulib, and then use that.

     

Log in to post a comment.

MongoDB Logo MongoDB