diff --git a/H/YapHandles.h b/H/YapHandles.h index da23c6dc2..e63d594a2 100755 --- a/H/YapHandles.h +++ b/H/YapHandles.h @@ -114,7 +114,9 @@ Yap_PutInSlot(yhandle_t slot, Term t USES_REGS) LOCAL_SlotBase[slot] = t; } +#ifndef max #define max(X,Y) ( X > Y ? X : Y ) +#endif static inline void ensure_slots(int N USES_REGS) diff --git a/H/YapTerm.h b/H/YapTerm.h index 81ccfc66f..10934ddf0 100644 --- a/H/YapTerm.h +++ b/H/YapTerm.h @@ -54,9 +54,13 @@ typedef uintptr_t UInt; /* typedef long int Int;*/ /* typedef unsigned long int UInt; */ +#if _WIN32 +#define Int_FORMAT "%d" +#define UInt_FORMAT "%u" +#else #define Int_FORMAT "%ld" #define UInt_FORMAT "%lu" - +#endif #else #error Yap require integer types of the same size as a pointer #endif diff --git a/H/pl-shared.h b/H/pl-shared.h index 14c400b20..43a5a91b6 100755 --- a/H/pl-shared.h +++ b/H/pl-shared.h @@ -77,9 +77,11 @@ typedef uintptr_t term_t; #if _WIN32 #ifndef THREADS +#ifndef WIN_PTHREADS_H typedef int pthread_t; #endif #endif +#endif typedef uintptr_t word; /* Anonymous 4 byte object */