factor/native/factor.h

144 lines
3.0 KiB
C
Raw Normal View History

2004-07-16 02:26:21 -04:00
#ifndef __FACTOR_H__
#define __FACTOR_H__
2004-12-13 15:39:27 -05:00
#if defined(i386) || defined(__i386) || defined(__i386__) || defined(WIN32)
2004-11-08 22:36:51 -05:00
#define FACTOR_X86
#endif
2004-12-13 16:17:05 -05:00
#if defined(WIN32)
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT
#endif
2004-11-08 22:36:51 -05:00
/* 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 */
2004-12-13 16:17:05 -05:00
DLLEXPORT CELL ds;
2004-11-08 22:36:51 -05:00
/* raw pointer to callstack bottom */
CELL cs_bot;
/* raw pointer to callstack top */
CELL cs;
2004-07-18 22:14:36 -04:00
#include <errno.h>
2004-07-24 00:54:57 -04:00
#include <fcntl.h>
#include <limits.h>
#include <math.h>
2004-07-16 02:26:21 -04:00
#include <setjmp.h>
2004-08-16 21:05:38 -04:00
#include <signal.h>
2004-07-16 02:26:21 -04:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
2004-12-11 15:02:34 -05:00
#include <time.h>
2004-12-10 21:39:45 -05:00
#ifdef WIN32
#include <windows.h>
2004-12-11 15:02:34 -05:00
/* Difference between Jan 1 00:00:00 1601 and Jan 1 00:00:00 1970 */
#define EPOCH_OFFSET 0x019db1ded53e8000LL
2004-12-10 21:39:45 -05:00
#else
#include <dirent.h>
#include <sys/mman.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <sys/time.h>
#include <netdb.h>
#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 <stdbool.h>
#endif
2004-07-16 02:26:21 -04:00
2004-09-18 18:15:01 -04:00
#ifdef FFI
#include <dlfcn.h>
#endif /* FFI */
2004-12-10 21:39:45 -05:00
#if defined(_MSC_VER)
#define INLINE static __inline
#else
#define INLINE inline static
#endif
2004-07-16 02:26:21 -04:00
#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<<HALF_WORD_SIZE)-1)
2004-07-16 02:26:21 -04:00
/* must always be 16 bits */
2004-12-10 21:39:45 -05:00
#define CHARS ((signed)sizeof(uint16_t))
2004-07-16 02:26:21 -04:00
/* must always be 8 bits */
typedef unsigned char BYTE;
/* Memory areas */
#define DEFAULT_ARENA (64 * 1024 * 1024)
#define COMPILE_ZONE_SIZE (64 * 1024 * 1024)
#define STACK_SIZE (2 * 1024 * 1024)
2004-07-16 02:26:21 -04:00
#include "memory.h"
#include "error.h"
2004-07-16 02:26:21 -04:00
#include "types.h"
#include "gc.h"
2004-11-08 22:36:51 -05:00
#include "boolean.h"
2004-08-05 15:18:31 -04:00
#include "word.h"
#include "run.h"
#include "signal.h"
2004-07-24 15:11:55 -04:00
#include "fixnum.h"
2004-08-27 02:09:24 -04:00
#include "array.h"
2004-08-24 23:46:55 -04:00
#include "s48_bignumint.h"
#include "s48_bignum.h"
#include "bignum.h"
2004-08-04 22:43:58 -04:00
#include "ratio.h"
2004-08-05 16:49:55 -04:00
#include "float.h"
2004-08-05 20:29:52 -04:00
#include "complex.h"
2004-07-28 19:02:24 -04:00
#include "arithmetic.h"
2004-08-04 03:12:55 -04:00
#include "misc.h"
2004-08-12 23:40:28 -04:00
#include "relocate.h"
2004-07-24 15:11:55 -04:00
#include "string.h"
2004-08-12 23:40:28 -04:00
#include "sbuf.h"
#include "port.h"
2004-08-20 01:50:59 -04:00
#include "io.h"
2004-08-20 01:49:14 -04:00
#include "read.h"
#include "write.h"
2004-07-24 00:54:57 -04:00
#include "file.h"
#include "socket.h"
2004-07-16 02:26:21 -04:00
#include "cons.h"
#include "image.h"
#include "primitives.h"
#include "vector.h"
#include "stack.h"
2004-09-06 02:32:04 -04:00
#include "compiler.h"
2004-09-18 18:15:01 -04:00
#include "ffi.h"
2004-07-16 02:26:21 -04:00
#endif /* __FACTOR_H__ */