4 #if (defined(__x86_64) && defined(__linux__)) || defined(__sparcv9) || \
6 /* NASAL_NAN64 mode requires 64 bit pointers that only use the
7 * lower 48 bits; Win64 and Irix should work with this too, but
8 * have not been tested */
10 #elif defined(__BYTE_ORDER__)
11 /* GCC and Clang define these (as a builtin, while
12 * __LITTLE_ENDIAN__ requires a header), MSVC doesn't */
13 # if __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__
15 # elif __BYTE_ORDER__==__ORDER_BIG_ENDIAN__
18 # error Unrecognized endianness
20 #elif defined(_M_IX86) || defined(__i386) || defined(__x86_64) || \
21 defined(__ia64__) || defined(_M_IA64) || defined(__ARMEL__) || \
22 defined(_M_X64) || defined(_M_ARM)
24 #elif defined(__sparc) || defined(__ARMEB__) || \
25 defined(__hppa__) || defined(__s390__) || defined(__s390x__)
28 # error Unknown endianness
38 struct naCCode* ccode;
39 struct naGhost* ghost;
42 /* On supported 64 bit platforms (those where all memory returned from
43 * naAlloc() is guaranteed to lie between 0 and 2^48-1) we union the
44 * double with the pointer, and use fancy tricks (see data.h) to make
45 * sure all pointers are stored as NaNs. 32 bit layouts (and 64 bit
46 * platforms where we haven't tested the trick above) need
47 * endianness-dependent ordering to make sure that the reftag lies in
48 * the top bits of the double */
51 typedef struct { naPtr ptr; int reftag; } naRefPart;
52 #elif defined(NASAL_BE)
53 typedef struct { int reftag; naPtr ptr; } naRefPart;
56 #if defined(NASAL_NAN64)
57 typedef union { double num; void* ptr; } naRef;
59 typedef union { double num; naRefPart ref; } naRef;