diff --git a/H/Yap.h b/H/Yap.h index 9807374b2..ec1d39ba2 100755 --- a/H/Yap.h +++ b/H/Yap.h @@ -50,7 +50,7 @@ #endif /* THREADS && (YAPOR_COW || YAPOR_SBA || YAPOR_COPY) */ // Bad export from Python -#include "config.h" +#include "YapConfig.h" #ifndef COROUTINING #define COROUTINING 1 @@ -74,6 +74,28 @@ #include #endif +typedef YAP_Int Int; +typedef YAP_UInt UInt; +typedef YAP_Short Short; +typedef YAP_UShort UShort; + +typedef uint16_t BITS16; +typedef int16_t SBITS16; +typedef uint32_t BITS32; + +typedef YAP_CELL CELL; + +typedef YAP_Term Term; + +#define WordSize sizeof(BITS16) +#define CellSize sizeof(CELL) +#define SmallSize sizeof(SMALLUNSGN) + +typedef YAP_Int Int; +typedef YAP_Float Float; +typedef YAP_handle_t yhandle_t; + +#define TermZERO ((Term)0) /* #define RATIONAL_TREES 1 diff --git a/YapTermConfig.h.cmake b/YapTermConfig.h.cmake index a76bf41b9..bafde36ba 100644 --- a/YapTermConfig.h.cmake +++ b/YapTermConfig.h.cmake @@ -55,4 +55,6 @@ #endif +#include "YapTerm.h" + #endif diff --git a/config.h.cmake b/config.h.cmake index 80f3a6854..c72a3dc99 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -2115,4 +2115,6 @@ calls it, or to nothing if 'inline' is not supported under any name. */ #endif #endif +#include "YapTermConfig.h" + #endif diff --git a/include/YapDefs.h b/include/YapDefs.h index 24b6ba9fe..58aa5a749 100755 --- a/include/YapDefs.h +++ b/include/YapDefs.h @@ -50,35 +50,6 @@ #include #include -/* The YAP main types */ -#include "YapTerm.h" - -#if HAVE_STDINT_H -#include -#endif -#if HAVE_INTTYPES_H -#include -#endif - -/** - FALSE and TRUE are the pre-standard versions, - still widely used. -*/ -#ifndef TRUE -#define TRUE true -#endif -#ifndef FALSE -#define FALSE false -#endif -#ifndef YAP_Bool -typedef bool YAP_Bool; -#endif - -/** - This term can never be constructed as a valid term, so it is - used as a "BAD" term -*/ -#define TermZERO ((Term)0) #include "YapConfig.h" diff --git a/include/YapTerm.h b/include/YapTerm.h index eea862360..0457ce3f4 100644 --- a/include/YapTerm.h +++ b/include/YapTerm.h @@ -13,17 +13,11 @@ * version: $Id: Yap.h,v 1.38 2008-06-18 10:02:27 vsc Exp $ * *************************************************************************/ -#ifndef YAP_H -#include "YapTermConfig.h" -#include "config.h" +#include -#endif -#if HAVE_STDINT_H -#include -#endif -#if HAVE_INTTYPES_H -#include +#if HAVE_STDTYPES_H +#include #endif /* truth-values */ @@ -41,6 +35,13 @@ typedef int _Bool; #endif #endif /* HAVE_STDBOOL_H */ +#if HAVE_STDINT_H +#include +#endif + +#if HAVE_INTTYPES_H +#include +#endif #define ALIGN_BY_TYPE(X, TYPE) \ (((CELL)(X) + (sizeof(TYPE) - 1)) & ~(sizeof(TYPE) - 1)) @@ -113,31 +114,6 @@ typedef void *YAP_Atom; typedef void *YAP_Functor; -#ifdef YAP_H - -typedef YAP_Int Int; -typedef YAP_UInt UInt; -typedef YAP_Short Short; -typedef YAP_UShort UShort; - -typedef uint16_t BITS16; -typedef int16_t SBITS16; -typedef uint32_t BITS32; - -typedef YAP_CELL CELL; - -typedef YAP_Term Term; - -#define WordSize sizeof(BITS16) -#define CellSize sizeof(CELL) -#define SmallSize sizeof(SMALLUNSGN) - -typedef YAP_Int Int; -typedef YAP_Float Float; -typedef YAP_handle_t yhandle_t; - -#endif - #include "YapError.h" #include "../os/encoding.h"