--- CBOR-XS/ecb.h 2013/10/26 10:41:12 1.2 +++ CBOR-XS/ecb.h 2013/11/17 05:26:14 1.4 @@ -1,7 +1,7 @@ /* * libecb - http://software.schmorp.de/pkg/libecb * - * Copyright (©) 2009-2012 Marc Alexander Lehmann + * Copyright (©) 2009-2013 Marc Alexander Lehmann * Copyright (©) 2011 Emanuele Giaquinta * All rights reserved. * @@ -589,10 +589,17 @@ #include /* for frexp*, ldexp*, INFINITY, NAN */ - #ifdef NEN + /* only the oldest of old doesn't have this one. solaris. */ + #ifdef INFINITY + #define ECB_INFINITY INFINITY + #else + #define ECB_INFINITY HUGE_VAL + #endif + + #ifdef NAN #define ECB_NAN NAN #else - #define ECB_NAN INFINITY + #define ECB_NAN ECB_INFINITY #endif /* converts an ieee half/binary16 to a float */ @@ -607,7 +614,7 @@ if (!e ) r = ldexpf (m , -24); else if (e != 31) r = ldexpf (m + 0x400, e - 25); else if (m ) r = ECB_NAN; - else r = INFINITY; + else r = ECB_INFINITY; return x & 0x8000 ? -r : r; }