Open razamatan opened 13 years ago
I've noticed this too. I use the following for JSON::YAJL, my Perl interface:
diff --git a/yajl/yajl_gen.c b/yajl/yajl_gen.c index d4770bb..fbc5187 100644 --- a/yajl/yajl_gen.c +++ b/yajl/yajl_gen.c @@ -195,6 +195,14 @@ yajl_gen_integer(yajl_gen g, long int number) #define isinf !_finite #endif +/* Solaris doesn't have isinf? */ +#if defined (__SVR4) && defined (__sun) +#ifndef isinf +#include+#define isinf(x) (!finite((x)) && (x)==(x)) +#endif +#endif + yajl_gen_status yajl_gen_double(yajl_gen g, double number) {
Just to let you know that I need to I apply a similar patch for YAJL 2.
i was basically getting symbol missing errors with yajl on open solaris. it turns out the box's math.h doesn't have isinf.
i googled, and this is problematic for a lot of other projects: http://www.google.com/search?q=open+solaris+isinf+undefined
the mysql bug thread is particularly convincing: http://bugs.mysql.com/bug.php?id=14862
for now, i got my yajl working by hacking this in there, but i know it's not safe since it's not testing for the environment to have ieeefp.h. sigh.
feel free to run w/ the environment checks.
fyi, i'm using yajl by way of py-yajl. this hack worked pretty well since it seems that the py-yajl build process ignores the necessity for cmake and goes straight to compiling using gcc. i'll likely file an issue with py-yajl with a fix to pass in some -Dsymbol to force the isinf setting. perhaps if the fix were to read #ifdef MISSING_ISINF based on not finding isinf in math.h, then i can do a similar test in py-yajl's setup.py to set that as an extra compiler flag.
thanks.