--- CBOR-XS/ecb.h 2013/10/26 10:41:12 1.2 +++ CBOR-XS/ecb.h 2013/12/10 13:54:40 1.5 @@ -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. * @@ -66,7 +66,7 @@ #endif /* work around x32 idiocy by defining proper macros */ -#if __x86_64 || _M_AMD64 +#if __amd64 || __x86_64 || _M_AMD64 || _M_X64 #if _ILP32 #define ECB_AMD64_X32 1 #else @@ -136,7 +136,7 @@ #elif defined __ARM_ARCH_7__ || defined __ARM_ARCH_7A__ \ || defined __ARM_ARCH_7M__ || defined __ARM_ARCH_7R__ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb" : : : "memory") - #elif __sparc || __sparc__ + #elif (__sparc || __sparc__) && !__sparcv8 #define ECB_MEMORY_FENCE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad | #StoreStore | #StoreLoad" : : : "memory") #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad" : : : "memory") #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("membar #LoadStore | #StoreStore") @@ -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; }