00001 #ifndef _NAREF_H
00002 #define _NAREF_H
00003
00004
00005
00006
00007
00008 #if (defined(__x86_64) && defined(__linux__)) || defined(__sparcv9) || \
00009 defined(__powerpc64__)
00010
00011
00012 # define NASAL_NAN64
00013 #elif defined(_M_IX86) || defined(i386) || defined(__x86_64) || \
00014 defined(__ia64__) || defined(_M_IA64) || defined(__ARMEL__) || \
00015 defined(_M_X64)
00016 # define NASAL_LE
00017 #elif defined(__sparc) || defined(__ppc__) || defined(__PPC) || \
00018 defined(__mips) || defined(__ARMEB__)
00019 # define NASAL_BE
00020 #else
00021 # error Unrecognized CPU architecture
00022 #endif
00023
00024 typedef union {
00025 struct naObj* obj;
00026 struct naStr* str;
00027 struct naVec* vec;
00028 struct naHash* hash;
00029 struct naCode* code;
00030 struct naFunc* func;
00031 struct naCCode* ccode;
00032 struct naGhost* ghost;
00033 } naPtr;
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #if defined(NASAL_LE)
00044 typedef struct { naPtr ptr; int reftag; } naRefPart;
00045 #elif defined(NASAL_BE)
00046 typedef struct { int reftag; naPtr ptr; } naRefPart;
00047 #endif
00048
00049 #if defined(NASAL_NAN64)
00050 typedef union { double num; void* ptr; } naRef;
00051 #else
00052 typedef union { double num; naRefPart ref; } naRef;
00053 #endif
00054
00055 #endif // _NAREF_H