#ifndef __FACTOR_H__ #define __FACTOR_H__ #if defined(i386) || defined(__i386) || defined(__i386__) || defined(WIN32) #define FACTOR_X86 #endif #if defined(WIN32) #define DLLEXPORT __declspec(dllexport) #else #define DLLEXPORT #endif /* CELL must be 32 bits and your system must have 32-bit pointers */ typedef unsigned long int CELL; #define CELLS ((signed)sizeof(CELL)) /* raw pointer to datastack bottom */ CELL ds_bot; /* raw pointer to datastack top */ DLLEXPORT CELL ds; /* raw pointer to callstack bottom */ CELL cs_bot; /* raw pointer to callstack top */ CELL cs; #include #include #include #include #include #include #include #include #include #include #ifdef WIN32 #include /* Difference between Jan 1 00:00:00 1601 and Jan 1 00:00:00 1970 */ #define EPOCH_OFFSET 0x019db1ded53e8000LL #else #include #include #include #include #include #include #include #include #include #include #include #endif #if defined(_MSC_VER) #pragma warning(disable:4312) #pragma warning(disable:4311) typedef enum { false, true } _Bool; typedef enum _Bool bool; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; typedef unsigned __int64 uint64_t; typedef signed char int8_t; typedef signed short int16_t; typedef signed int int32_t; typedef signed __int64 int64_t; #define snprintf _snprintf #else #include #endif #ifdef FFI #include #endif /* FFI */ #if defined(_MSC_VER) #define INLINE static __inline #else #define INLINE inline static #endif #define FIXNUM_MAX (LONG_MAX >> TAG_BITS) #define FIXNUM_MIN (LONG_MIN >> TAG_BITS) #define F_FIXNUM long int /* unboxed */ #define WORD_SIZE (CELLS*8) #define HALF_WORD_SIZE (CELLS*4) #define HALF_WORD_MASK (((unsigned long)1<