64 bit cleanups.
This commit is contained in:
parent
c074076e89
commit
11641c5f94
12
C/alloc.c
12
C/alloc.c
@ -869,11 +869,12 @@ static MALLOC_T
|
|||||||
InitWorkSpace(Int s)
|
InitWorkSpace(Int s)
|
||||||
{
|
{
|
||||||
SYSTEM_INFO si;
|
SYSTEM_INFO si;
|
||||||
|
Int psz;
|
||||||
|
|
||||||
GetSystemInfo(&si);
|
GetSystemInfo(&si);
|
||||||
Yap_page_size = si.dwPageSize;
|
psz = Yap_page_size = si.dwPageSize;
|
||||||
s = ((s+ (YAP_ALLOC_SIZE-1))/YAP_ALLOC_SIZE)*YAP_ALLOC_SIZE;
|
s = ((s+ (YAP_ALLOC_SIZE-1))/YAP_ALLOC_SIZE)*YAP_ALLOC_SIZE;
|
||||||
brk = (LPVOID)Yap_page_size;
|
brk = (LPVOID)psz;
|
||||||
if (!ExtendWorkSpace(s,0))
|
if (!ExtendWorkSpace(s,0))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
return (MALLOC_T)brk-s;
|
return (MALLOC_T)brk-s;
|
||||||
@ -1535,13 +1536,8 @@ Yap_InitMemory(UInt Trail, UInt Heap, UInt Stack)
|
|||||||
(UInt) Yap_LocalBase, (UInt) Yap_TrailTop);
|
(UInt) Yap_LocalBase, (UInt) Yap_TrailTop);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !SHORT_INTS
|
fprintf(stderr, "Heap+Aux: " UInt_FORMAT "\tLocal+Global: " UInt_FORMAT "\tTrail: " UInt_FORMAT "\n",
|
||||||
fprintf(stderr, "Heap+Aux: %d\tLocal+Global: %d\tTrail: %d\n",
|
|
||||||
pm - sa - ta, sa, ta);
|
pm - sa - ta, sa, ta);
|
||||||
#else /* SHORT_INTS */
|
|
||||||
fprintf(stderr, "Heap+Aux: %ld\tLocal+Global: %ld\tTrail: %ld\n",
|
|
||||||
pm - sa - ta, sa, ta);
|
|
||||||
#endif /* SHORT_INTS */
|
|
||||||
}
|
}
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
}
|
}
|
||||||
|
12
C/cdmgr.c
12
C/cdmgr.c
@ -2031,22 +2031,14 @@ addcl_permission_error(AtomEntry *ap, Int Arity, int in_use)
|
|||||||
sprintf(Yap_ErrorMessage, "static predicate %s is in use", ap->StrOfAE);
|
sprintf(Yap_ErrorMessage, "static predicate %s is in use", ap->StrOfAE);
|
||||||
else
|
else
|
||||||
sprintf(Yap_ErrorMessage,
|
sprintf(Yap_ErrorMessage,
|
||||||
#if SHORT_INTS
|
"static predicate %s/" Int_FORMAT " is in use",
|
||||||
"static predicate %s/%ld is in use",
|
|
||||||
#else
|
|
||||||
"static predicate %s/%d is in use",
|
|
||||||
#endif
|
|
||||||
ap->StrOfAE, Arity);
|
ap->StrOfAE, Arity);
|
||||||
} else {
|
} else {
|
||||||
if (Arity == 0)
|
if (Arity == 0)
|
||||||
sprintf(Yap_ErrorMessage, "system predicate %s", ap->StrOfAE);
|
sprintf(Yap_ErrorMessage, "system predicate %s", ap->StrOfAE);
|
||||||
else
|
else
|
||||||
sprintf(Yap_ErrorMessage,
|
sprintf(Yap_ErrorMessage,
|
||||||
#if SHORT_INTS
|
"system predicate %s/" Int_FORMAT,
|
||||||
"system predicate %s/%ld",
|
|
||||||
#else
|
|
||||||
"system predicate %s/%d",
|
|
||||||
#endif
|
|
||||||
ap->StrOfAE, Arity);
|
ap->StrOfAE, Arity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ typedef struct mem_blk {
|
|||||||
#define FIRST_CMEM_BLK_SIZE (16*4096)
|
#define FIRST_CMEM_BLK_SIZE (16*4096)
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
AllocCMem (int size, struct intermediates *cip)
|
AllocCMem (UInt size, struct intermediates *cip)
|
||||||
{
|
{
|
||||||
#if SIZEOF_INT_P==8
|
#if SIZEOF_INT_P==8
|
||||||
size = (size + 7) & 0xfffffffffffffff8L;
|
size = (size + 7) & 0xfffffffffffffff8L;
|
||||||
@ -179,7 +179,7 @@ Yap_ReleaseCMem (struct intermediates *cip)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
Yap_AllocCMem (int size, struct intermediates *cip)
|
Yap_AllocCMem (UInt size, struct intermediates *cip)
|
||||||
{
|
{
|
||||||
return AllocCMem(size, cip);
|
return AllocCMem(size, cip);
|
||||||
}
|
}
|
||||||
|
@ -3848,7 +3848,7 @@ do_gc(Int predarity, CELL *current_env, yamop *nextop)
|
|||||||
fprintf(Yap_stderr, "%% Mark: Marked %ld cells of %ld (efficiency: %ld%%) in %g sec\n",
|
fprintf(Yap_stderr, "%% Mark: Marked %ld cells of %ld (efficiency: %ld%%) in %g sec\n",
|
||||||
(long int)tot, (long int)heap_cells, (long int)effectiveness, (double)(m_time-time_start)/1000);
|
(long int)tot, (long int)heap_cells, (long int)effectiveness, (double)(m_time-time_start)/1000);
|
||||||
if (HGEN-H0)
|
if (HGEN-H0)
|
||||||
fprintf(Yap_stderr,"%% previous generation has size %lu, with %lu (%lu%%) unmarked\n", (unsigned long)(HGEN-H0), (HGEN-H0)-total_oldies, 100*((HGEN-H0)-total_oldies)/(HGEN-H0));
|
fprintf(Yap_stderr,"%% previous generation has size " UInt_FORMAT ", with " UInt_FORMAT " (" UInt_FORMAT "%%) unmarked\n", (UInt)(HGEN-H0), (UInt)((HGEN-H0)-total_oldies), (UInt)(100*((HGEN-H0)-total_oldies)/(HGEN-H0)));
|
||||||
#ifdef INSTRUMENT_GC
|
#ifdef INSTRUMENT_GC
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
10
C/iopreds.c
10
C/iopreds.c
@ -2000,7 +2000,7 @@ find_csult_file (char *source, char *buf, StreamDesc * st, char *io_mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* given a stream index, get the corresponding fd */
|
/* given a stream index, get the corresponding fd */
|
||||||
static int
|
static Int
|
||||||
GetStreamFd(int sno)
|
GetStreamFd(int sno)
|
||||||
{
|
{
|
||||||
#if USE_SOCKET
|
#if USE_SOCKET
|
||||||
@ -2010,7 +2010,7 @@ GetStreamFd(int sno)
|
|||||||
#endif
|
#endif
|
||||||
if (Stream[sno].status & Pipe_Stream_f) {
|
if (Stream[sno].status & Pipe_Stream_f) {
|
||||||
#if _MSC_VER || defined(__MINGW32__)
|
#if _MSC_VER || defined(__MINGW32__)
|
||||||
return((int)(Stream[sno].u.pipe.hdl));
|
return((Int)(Stream[sno].u.pipe.hdl));
|
||||||
#else
|
#else
|
||||||
return(Stream[sno].u.pipe.fd);
|
return(Stream[sno].u.pipe.fd);
|
||||||
#endif
|
#endif
|
||||||
@ -2020,7 +2020,7 @@ GetStreamFd(int sno)
|
|||||||
return(YP_fileno(Stream[sno].u.file.file));
|
return(YP_fileno(Stream[sno].u.file.file));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
Int
|
||||||
Yap_GetStreamFd(int sno)
|
Yap_GetStreamFd(int sno)
|
||||||
{
|
{
|
||||||
return GetStreamFd(sno);
|
return GetStreamFd(sno);
|
||||||
@ -5990,7 +5990,7 @@ p_all_char_conversions(void)
|
|||||||
return(Yap_unify(ARG1,out));
|
return(Yap_unify(ARG1,out));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
Int
|
||||||
Yap_StreamToFileNo(Term t)
|
Yap_StreamToFileNo(Term t)
|
||||||
{
|
{
|
||||||
int sno =
|
int sno =
|
||||||
@ -5998,7 +5998,7 @@ Yap_StreamToFileNo(Term t)
|
|||||||
if (Stream[sno].status & Pipe_Stream_f) {
|
if (Stream[sno].status & Pipe_Stream_f) {
|
||||||
UNLOCK(Stream[sno].streamlock);
|
UNLOCK(Stream[sno].streamlock);
|
||||||
#if _MSC_VER || defined(__MINGW32__)
|
#if _MSC_VER || defined(__MINGW32__)
|
||||||
return((int)(Stream[sno].u.pipe.hdl));
|
return((Int)(Stream[sno].u.pipe.hdl));
|
||||||
#else
|
#else
|
||||||
return(Stream[sno].u.pipe.fd);
|
return(Stream[sno].u.pipe.fd);
|
||||||
#endif
|
#endif
|
||||||
|
68
C/stdpreds.c
68
C/stdpreds.c
@ -948,11 +948,7 @@ p_name(void)
|
|||||||
String = Yap_PreAllocCodeSpace();
|
String = Yap_PreAllocCodeSpace();
|
||||||
if (String + 1024 > (char *)AuxSp)
|
if (String + 1024 > (char *)AuxSp)
|
||||||
goto expand_auxsp;
|
goto expand_auxsp;
|
||||||
#if SHORT_INTS
|
sprintf(String, Int_FORMAT, IntOfTerm(AtomNameT));
|
||||||
sprintf(String, "%ld", IntOfTerm(AtomNameT));
|
|
||||||
#else
|
|
||||||
sprintf(String, "%d", IntOfTerm(AtomNameT));
|
|
||||||
#endif
|
|
||||||
} else if (IsFloatTerm(AtomNameT)) {
|
} else if (IsFloatTerm(AtomNameT)) {
|
||||||
String = Yap_PreAllocCodeSpace();
|
String = Yap_PreAllocCodeSpace();
|
||||||
if (String + 1024 > (char *)AuxSp)
|
if (String + 1024 > (char *)AuxSp)
|
||||||
@ -964,11 +960,7 @@ p_name(void)
|
|||||||
if (String + 1024 > (char *)AuxSp)
|
if (String + 1024 > (char *)AuxSp)
|
||||||
goto expand_auxsp;
|
goto expand_auxsp;
|
||||||
|
|
||||||
#if SHORT_INTS
|
sprintf(String, Int_FORMAT, LongIntOfTerm(AtomNameT));
|
||||||
sprintf(String, "%ld", LongIntOfTerm(AtomNameT));
|
|
||||||
#else
|
|
||||||
sprintf(String, "%d", LongIntOfTerm(AtomNameT));
|
|
||||||
#endif
|
|
||||||
#if USE_GMP
|
#if USE_GMP
|
||||||
} else if (IsBigIntTerm(AtomNameT)) {
|
} else if (IsBigIntTerm(AtomNameT)) {
|
||||||
String = Yap_PreAllocCodeSpace();
|
String = Yap_PreAllocCodeSpace();
|
||||||
@ -1505,9 +1497,9 @@ p_atomic_concat(void)
|
|||||||
char *cptr = (char *)wcptr;
|
char *cptr = (char *)wcptr;
|
||||||
|
|
||||||
#if HAVE_SNPRINTF
|
#if HAVE_SNPRINTF
|
||||||
sz = snprintf(cptr, (wtop-wcptr)-1024,"%ld", (long int)IntegerOfTerm(thead));
|
sz = snprintf(cptr, (wtop-wcptr)-1024,Int_FORMAT, IntegerOfTerm(thead));
|
||||||
#else
|
#else
|
||||||
sz = sprintf(cptr,"%ld", (long int)IntegerOfTerm(thead));
|
sz = sprintf(cptr,Int_FORMAT, IntegerOfTerm(thead));
|
||||||
#endif
|
#endif
|
||||||
for (i=sz; i>0; i--) {
|
for (i=sz; i>0; i--) {
|
||||||
wcptr[i-1] = cptr[i-1];
|
wcptr[i-1] = cptr[i-1];
|
||||||
@ -1608,9 +1600,9 @@ p_atomic_concat(void)
|
|||||||
cptr += sz;
|
cptr += sz;
|
||||||
} else if (IsIntegerTerm(thead)) {
|
} else if (IsIntegerTerm(thead)) {
|
||||||
#if HAVE_SNPRINTF
|
#if HAVE_SNPRINTF
|
||||||
snprintf(cptr, (top-cptr)-1024,"%ld", (long int)IntegerOfTerm(thead));
|
snprintf(cptr, (top-cptr)-1024,Int_FORMAT, IntegerOfTerm(thead));
|
||||||
#else
|
#else
|
||||||
sprintf(cptr,"%ld", (long int)IntegerOfTerm(thead));
|
sprintf(cptr, Int_FORMAT, IntegerOfTerm(thead));
|
||||||
#endif
|
#endif
|
||||||
while (*cptr && cptr < top-1024) cptr++;
|
while (*cptr && cptr < top-1024) cptr++;
|
||||||
} else if (IsFloatTerm(thead)) {
|
} else if (IsFloatTerm(thead)) {
|
||||||
@ -1957,19 +1949,11 @@ p_number_chars(void)
|
|||||||
Yap_Error(TYPE_ERROR_NUMBER, t1, "number_chars/2");
|
Yap_Error(TYPE_ERROR_NUMBER, t1, "number_chars/2");
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
} else if (IsIntTerm(t1)) {
|
} else if (IsIntTerm(t1)) {
|
||||||
#if SHORT_INTS
|
sprintf(String, Int_FORMAT, IntOfTerm(t1));
|
||||||
sprintf(String, "%ld", IntOfTerm(t1));
|
|
||||||
#else
|
|
||||||
sprintf(String, "%d", IntOfTerm(t1));
|
|
||||||
#endif
|
|
||||||
} else if (IsFloatTerm(t1)) {
|
} else if (IsFloatTerm(t1)) {
|
||||||
sprintf(String, "%f", FloatOfTerm(t1));
|
sprintf(String, "%f", FloatOfTerm(t1));
|
||||||
} else if (IsLongIntTerm(t1)) {
|
} else if (IsLongIntTerm(t1)) {
|
||||||
#if SHORT_INTS
|
sprintf(String, Int_FORMAT, LongIntOfTerm(t1));
|
||||||
sprintf(String, "%ld", LongIntOfTerm(t1));
|
|
||||||
#else
|
|
||||||
sprintf(String, "%d", LongIntOfTerm(t1));
|
|
||||||
#endif
|
|
||||||
#if USE_GMP
|
#if USE_GMP
|
||||||
} else if (IsBigIntTerm(t1)) {
|
} else if (IsBigIntTerm(t1)) {
|
||||||
mpz_get_str(String, 10, Yap_BigIntOfTerm(t1));
|
mpz_get_str(String, 10, Yap_BigIntOfTerm(t1));
|
||||||
@ -2111,20 +2095,12 @@ p_number_atom(void)
|
|||||||
|
|
||||||
if (IsIntTerm(t1)) {
|
if (IsIntTerm(t1)) {
|
||||||
|
|
||||||
#if SHORT_INTS
|
sprintf(String, Int_FORMAT, IntOfTerm(t1));
|
||||||
sprintf(String, "%ld", IntOfTerm(t1));
|
|
||||||
#else
|
|
||||||
sprintf(String, "%d", IntOfTerm(t1));
|
|
||||||
#endif
|
|
||||||
} else if (IsFloatTerm(t1)) {
|
} else if (IsFloatTerm(t1)) {
|
||||||
sprintf(String, "%f", FloatOfTerm(t1));
|
sprintf(String, "%f", FloatOfTerm(t1));
|
||||||
} else if (IsLongIntTerm(t1)) {
|
} else if (IsLongIntTerm(t1)) {
|
||||||
|
|
||||||
#if SHORT_INTS
|
sprintf(String, Int_FORMAT, LongIntOfTerm(t1));
|
||||||
sprintf(String, "%ld", LongIntOfTerm(t1));
|
|
||||||
#else
|
|
||||||
sprintf(String, "%d", LongIntOfTerm(t1));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_GMP
|
#if USE_GMP
|
||||||
} else if (IsBigIntTerm(t1)) {
|
} else if (IsBigIntTerm(t1)) {
|
||||||
@ -2177,19 +2153,11 @@ p_number_codes(void)
|
|||||||
}
|
}
|
||||||
if (IsNonVarTerm(t1) && IsVarTerm(t)) {
|
if (IsNonVarTerm(t1) && IsVarTerm(t)) {
|
||||||
if (IsIntTerm(t1)) {
|
if (IsIntTerm(t1)) {
|
||||||
#if SHORT_INTS
|
sprintf(String, Int_FORMAT, IntOfTerm(t1));
|
||||||
sprintf(String, "%ld", IntOfTerm(t1));
|
|
||||||
#else
|
|
||||||
sprintf(String, "%d", IntOfTerm(t1));
|
|
||||||
#endif
|
|
||||||
} else if (IsFloatTerm(t1)) {
|
} else if (IsFloatTerm(t1)) {
|
||||||
sprintf(String, "%f", FloatOfTerm(t1));
|
sprintf(String, "%f", FloatOfTerm(t1));
|
||||||
} else if (IsLongIntTerm(t1)) {
|
} else if (IsLongIntTerm(t1)) {
|
||||||
#if SHORT_INTS
|
sprintf(String, Int_FORMAT, LongIntOfTerm(t1));
|
||||||
sprintf(String, "%ld", LongIntOfTerm(t1));
|
|
||||||
#else
|
|
||||||
sprintf(String, "%d", LongIntOfTerm(t1));
|
|
||||||
#endif
|
|
||||||
#if USE_GMP
|
#if USE_GMP
|
||||||
} else if (IsBigIntTerm(t1)) {
|
} else if (IsBigIntTerm(t1)) {
|
||||||
mpz_get_str(String, 10, Yap_BigIntOfTerm(t1));
|
mpz_get_str(String, 10, Yap_BigIntOfTerm(t1));
|
||||||
@ -2276,19 +2244,11 @@ p_atom_number(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (IsIntTerm(t2)) {
|
if (IsIntTerm(t2)) {
|
||||||
#if SHORT_INTS
|
sprintf(String, Int_FORMAT, IntOfTerm(t2));
|
||||||
sprintf(String, "%ld", IntOfTerm(t2));
|
|
||||||
#else
|
|
||||||
sprintf(String, "%d", IntOfTerm(t2));
|
|
||||||
#endif
|
|
||||||
} else if (IsFloatTerm(t2)) {
|
} else if (IsFloatTerm(t2)) {
|
||||||
sprintf(String, "%g", FloatOfTerm(t2));
|
sprintf(String, "%g", FloatOfTerm(t2));
|
||||||
} else if (IsLongIntTerm(t2)) {
|
} else if (IsLongIntTerm(t2)) {
|
||||||
#if SHORT_INTS
|
sprintf(String, Int_FORMAT, LongIntOfTerm(t2));
|
||||||
sprintf(String, "%ld", LongIntOfTerm(t2));
|
|
||||||
#else
|
|
||||||
sprintf(String, "%d", LongIntOfTerm(t2));
|
|
||||||
#endif
|
|
||||||
#if USE_GMP
|
#if USE_GMP
|
||||||
} else if (IsBigIntTerm(t2)) {
|
} else if (IsBigIntTerm(t2)) {
|
||||||
mpz_get_str(String, 10, Yap_BigIntOfTerm(t2));
|
mpz_get_str(String, 10, Yap_BigIntOfTerm(t2));
|
||||||
|
@ -71,8 +71,6 @@ clean_dirty_tr(tr_fr_ptr TR0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int show;
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
copy_complex_term(CELL *pt0, CELL *pt0_end, int share, int newattvs, CELL *ptf, CELL *HLow)
|
copy_complex_term(CELL *pt0, CELL *pt0_end, int share, int newattvs, CELL *ptf, CELL *HLow)
|
||||||
{
|
{
|
||||||
@ -92,7 +90,6 @@ copy_complex_term(CELL *pt0, CELL *pt0_end, int share, int newattvs, CELL *ptf,
|
|||||||
register CELL d0;
|
register CELL d0;
|
||||||
register CELL *ptd0;
|
register CELL *ptd0;
|
||||||
++ pt0;
|
++ pt0;
|
||||||
if (show) fprintf(stderr,"pt0=%p\n",pt0);
|
|
||||||
ptd0 = pt0;
|
ptd0 = pt0;
|
||||||
d0 = *ptd0;
|
d0 = *ptd0;
|
||||||
deref_head(d0, copy_term_unk);
|
deref_head(d0, copy_term_unk);
|
||||||
@ -144,7 +141,6 @@ copy_complex_term(CELL *pt0, CELL *pt0_end, int share, int newattvs, CELL *ptf,
|
|||||||
register CELL *ap2;
|
register CELL *ap2;
|
||||||
/* store the terms to visit */
|
/* store the terms to visit */
|
||||||
ap2 = RepAppl(d0);
|
ap2 = RepAppl(d0);
|
||||||
if (show) fprintf(stderr,"d0=%lx %p %lx\n",d0,ap2,*ap2);
|
|
||||||
if (ap2 >= HB && ap2 <= H) {
|
if (ap2 >= HB && ap2 <= H) {
|
||||||
/* If this is newer than the current term, just reuse */
|
/* If this is newer than the current term, just reuse */
|
||||||
*ptf++ = d0;
|
*ptf++ = d0;
|
||||||
|
12
C/write.c
12
C/write.c
@ -98,17 +98,9 @@ wrputn(Int n, wrf writewch) /* writes an integer */
|
|||||||
wrputc(' ', writewch);
|
wrputc(' ', writewch);
|
||||||
}
|
}
|
||||||
#if HAVE_SNPRINTF
|
#if HAVE_SNPRINTF
|
||||||
#if SHORT_INTS
|
snprintf(s, 256, Int_FORMAT, n);
|
||||||
snprintf(s, 256, "%ld", n);
|
|
||||||
#else
|
#else
|
||||||
snprintf(s, 256, "%d", n);
|
sprintf(s, Int_FORMAT, n);
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#if SHORT_INTS
|
|
||||||
sprintf(s, "%ld", n);
|
|
||||||
#else
|
|
||||||
sprintf(s, "%d", n);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
while (*s1)
|
while (*s1)
|
||||||
wrputc(*s1++, writewch);
|
wrputc(*s1++, writewch);
|
||||||
|
6
H/Yap.h
6
H/Yap.h
@ -165,8 +165,8 @@
|
|||||||
/* */ typedef long int Int;
|
/* */ typedef long int Int;
|
||||||
/* */ typedef unsigned long int UInt;
|
/* */ typedef unsigned long int UInt;
|
||||||
|
|
||||||
#define Int_FORMAT "%l"
|
#define Int_FORMAT "%ld"
|
||||||
#define UInt_FORMAT "%ul"
|
#define UInt_FORMAT "%lu"
|
||||||
|
|
||||||
#else
|
#else
|
||||||
# error Yap require integer types of the same size as a pointer
|
# error Yap require integer types of the same size as a pointer
|
||||||
@ -193,7 +193,7 @@
|
|||||||
/* */ typedef long int Int;
|
/* */ typedef long int Int;
|
||||||
/* */ typedef unsigned long int UInt;
|
/* */ typedef unsigned long int UInt;
|
||||||
|
|
||||||
#define Int_FORMAT "%l"
|
#define Int_FORMAT "%ld"
|
||||||
#define UInt_FORMAT "%lu"
|
#define UInt_FORMAT "%lu"
|
||||||
|
|
||||||
# elif SIZEOF_LONG_LONG_INT==8
|
# elif SIZEOF_LONG_LONG_INT==8
|
||||||
|
@ -326,7 +326,7 @@ void STD_PROTO(Yap_emit,(compiler_vm_op,Int,CELL, struct intermediates *));
|
|||||||
void STD_PROTO(Yap_emit_3ops,(compiler_vm_op,CELL,CELL,CELL, struct intermediates *));
|
void STD_PROTO(Yap_emit_3ops,(compiler_vm_op,CELL,CELL,CELL, struct intermediates *));
|
||||||
void STD_PROTO(Yap_emit_4ops,(compiler_vm_op,CELL,CELL,CELL,CELL, struct intermediates *));
|
void STD_PROTO(Yap_emit_4ops,(compiler_vm_op,CELL,CELL,CELL,CELL, struct intermediates *));
|
||||||
CELL *STD_PROTO(Yap_emit_extra_size,(compiler_vm_op,CELL,int, struct intermediates *));
|
CELL *STD_PROTO(Yap_emit_extra_size,(compiler_vm_op,CELL,int, struct intermediates *));
|
||||||
char *STD_PROTO(Yap_AllocCMem,(int, struct intermediates *));
|
char *STD_PROTO(Yap_AllocCMem,(UInt, struct intermediates *));
|
||||||
void STD_PROTO(Yap_ReleaseCMem, (struct intermediates *));
|
void STD_PROTO(Yap_ReleaseCMem, (struct intermediates *));
|
||||||
int STD_PROTO(Yap_is_a_test_pred,(Term, Term));
|
int STD_PROTO(Yap_is_a_test_pred,(Term, Term));
|
||||||
void STD_PROTO(Yap_bip_name,(Int, char *));
|
void STD_PROTO(Yap_bip_name,(Int, char *));
|
||||||
|
@ -303,7 +303,7 @@ void STD_PROTO(Yap_UnLockStream,(int));
|
|||||||
#define Yap_LockStream(X)
|
#define Yap_LockStream(X)
|
||||||
#define Yap_UnLockStream(X)
|
#define Yap_UnLockStream(X)
|
||||||
#endif
|
#endif
|
||||||
int STD_PROTO(Yap_GetStreamFd,(int));
|
Int STD_PROTO(Yap_GetStreamFd,(int));
|
||||||
void STD_PROTO(Yap_CloseStreams,(int));
|
void STD_PROTO(Yap_CloseStreams,(int));
|
||||||
void STD_PROTO(Yap_FlushStreams,(void));
|
void STD_PROTO(Yap_FlushStreams,(void));
|
||||||
void STD_PROTO(Yap_CloseStream,(int));
|
void STD_PROTO(Yap_CloseStream,(int));
|
||||||
@ -311,7 +311,7 @@ int STD_PROTO(Yap_PlGetchar,(void));
|
|||||||
int STD_PROTO(Yap_PlGetWchar,(void));
|
int STD_PROTO(Yap_PlGetWchar,(void));
|
||||||
int STD_PROTO(Yap_PlFGetchar,(void));
|
int STD_PROTO(Yap_PlFGetchar,(void));
|
||||||
int STD_PROTO(Yap_GetCharForSIGINT,(void));
|
int STD_PROTO(Yap_GetCharForSIGINT,(void));
|
||||||
int STD_PROTO(Yap_StreamToFileNo,(Term));
|
Int STD_PROTO(Yap_StreamToFileNo,(Term));
|
||||||
Term STD_PROTO(Yap_OpenStream,(FILE *,char *,Term,int));
|
Term STD_PROTO(Yap_OpenStream,(FILE *,char *,Term,int));
|
||||||
Term STD_PROTO(Yap_StringToTerm,(char *,Term *));
|
Term STD_PROTO(Yap_StringToTerm,(char *,Term *));
|
||||||
Term STD_PROTO(Yap_TermToString,(Term,char *,unsigned int,int));
|
Term STD_PROTO(Yap_TermToString,(Term,char *,unsigned int,int));
|
||||||
|
73
configure
vendored
73
configure
vendored
@ -753,6 +753,7 @@ enable_use_malloc
|
|||||||
enable_condor
|
enable_condor
|
||||||
enable_chr
|
enable_chr
|
||||||
enable_clpqr
|
enable_clpqr
|
||||||
|
enable_win64
|
||||||
enable_april
|
enable_april
|
||||||
enable_dlcompat
|
enable_dlcompat
|
||||||
enable_cplint
|
enable_cplint
|
||||||
@ -1419,6 +1420,7 @@ Optional Features:
|
|||||||
--enable-condor allow Yap to be used from condor
|
--enable-condor allow Yap to be used from condor
|
||||||
--enable-chr install chr library
|
--enable-chr install chr library
|
||||||
--enable-clpqr install clpqr library
|
--enable-clpqr install clpqr library
|
||||||
|
--enable-win64 compile YAP for win64
|
||||||
--enable-april compile Yap to support April ILP system
|
--enable-april compile Yap to support April ILP system
|
||||||
--enable-dlcompat use dlcompat library for dynamic loading on Mac OS X
|
--enable-dlcompat use dlcompat library for dynamic loading on Mac OS X
|
||||||
--enable-cplint=DIR enable the cplint library using the glu library in DIR/lib
|
--enable-cplint=DIR enable the cplint library using the glu library in DIR/lib
|
||||||
@ -3683,6 +3685,13 @@ else
|
|||||||
use_clpqr=yes
|
use_clpqr=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check whether --enable-win64 was given.
|
||||||
|
if test "${enable_win64+set}" = set; then :
|
||||||
|
enableval=$enable_win64; target_win64="$enableval"
|
||||||
|
else
|
||||||
|
target_win64=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Check whether --enable-april was given.
|
# Check whether --enable-april was given.
|
||||||
if test "${enable_april+set}" = set; then :
|
if test "${enable_april+set}" = set; then :
|
||||||
@ -4897,13 +4906,55 @@ then
|
|||||||
INSTALL_COMMAND=install_win32
|
INSTALL_COMMAND=install_win32
|
||||||
if test "$cygwin" = "no" -o "$target_os" = "mingw32"
|
if test "$cygwin" = "no" -o "$target_os" = "mingw32"
|
||||||
then
|
then
|
||||||
if test "$target_os" = "cygwin"
|
if test "$target_win64" = yes
|
||||||
then
|
then
|
||||||
CC="${CC} -mno-cygwin"
|
|
||||||
CXX="${CXX} -mno-cygwin"
|
|
||||||
fi
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lwsock32" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lws2_32" >&5
|
||||||
|
$as_echo_n "checking for main in -lws2_32... " >&6; }
|
||||||
|
if test "${ac_cv_lib_ws2_32_main+set}" = set; then :
|
||||||
|
$as_echo_n "(cached) " >&6
|
||||||
|
else
|
||||||
|
ac_check_lib_save_LIBS=$LIBS
|
||||||
|
LIBS="-lws2_32 $LIBS"
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
return main ();
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_link "$LINENO"; then :
|
||||||
|
ac_cv_lib_ws2_32_main=yes
|
||||||
|
else
|
||||||
|
ac_cv_lib_ws2_32_main=no
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
LIBS=$ac_check_lib_save_LIBS
|
||||||
|
fi
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_main" >&5
|
||||||
|
$as_echo "$ac_cv_lib_ws2_32_main" >&6; }
|
||||||
|
if test "x$ac_cv_lib_ws2_32_main" = x""yes; then :
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_LIBWS2_32 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
LIBS="-lws2_32 $LIBS"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
if test "$target_os" = "cygwin"
|
||||||
|
then
|
||||||
|
CC="${CC} -mno-cygwin"
|
||||||
|
CXX="${CXX} -mno-cygwin"
|
||||||
|
fi
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lwsock32" >&5
|
||||||
$as_echo_n "checking for main in -lwsock32... " >&6; }
|
$as_echo_n "checking for main in -lwsock32... " >&6; }
|
||||||
if test "${ac_cv_lib_wsock32_main+set}" = set; then :
|
if test "${ac_cv_lib_wsock32_main+set}" = set; then :
|
||||||
$as_echo_n "(cached) " >&6
|
$as_echo_n "(cached) " >&6
|
||||||
@ -4942,7 +4993,7 @@ _ACEOF
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpsapi" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpsapi" >&5
|
||||||
$as_echo_n "checking for main in -lpsapi... " >&6; }
|
$as_echo_n "checking for main in -lpsapi... " >&6; }
|
||||||
if test "${ac_cv_lib_psapi_main+set}" = set; then :
|
if test "${ac_cv_lib_psapi_main+set}" = set; then :
|
||||||
$as_echo_n "(cached) " >&6
|
$as_echo_n "(cached) " >&6
|
||||||
@ -4981,6 +5032,7 @@ _ACEOF
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
yap_cv_readline=no
|
yap_cv_readline=no
|
||||||
if test "$prefix" = "NONE"
|
if test "$prefix" = "NONE"
|
||||||
then
|
then
|
||||||
@ -4990,7 +5042,7 @@ fi
|
|||||||
else
|
else
|
||||||
ENABLE_WINCONSOLE="#"
|
ENABLE_WINCONSOLE="#"
|
||||||
LIBS="-lcygwin"
|
LIBS="-lcygwin"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
INSTALL_COMMAND="install_unix"
|
INSTALL_COMMAND="install_unix"
|
||||||
ENABLE_WINCONSOLE="#"
|
ENABLE_WINCONSOLE="#"
|
||||||
@ -6780,7 +6832,7 @@ fi
|
|||||||
# and -fomit-frame-point -DBP_FREE
|
# and -fomit-frame-point -DBP_FREE
|
||||||
JAVALIBPATH=""
|
JAVALIBPATH=""
|
||||||
JAVAINCPATH="-I\"$JAVA_HOME\"/include -I\"$JAVA_HOME\"/include/win32"
|
JAVAINCPATH="-I\"$JAVA_HOME\"/include -I\"$JAVA_HOME\"/include/win32"
|
||||||
YAPLIB="libWYap.a"
|
YAPLIB="yap.dll"
|
||||||
SHLIB_CFLAGS=""
|
SHLIB_CFLAGS=""
|
||||||
SHLIB_LD="\$(CC) -shared -Wl,--export-all-symbols ../../yap.dll"
|
SHLIB_LD="\$(CC) -shared -Wl,--export-all-symbols ../../yap.dll"
|
||||||
SHLIB_LOWER_LD="\$(CC) -shared -Wl,--export-all-symbols ../../../yap.dll"
|
SHLIB_LOWER_LD="\$(CC) -shared -Wl,--export-all-symbols ../../../yap.dll"
|
||||||
@ -6788,7 +6840,10 @@ fi
|
|||||||
SHLIB_SWI_LD="\$(CC) -shared -Wl,--export-all-symbols ../../yap.dll ../../packages/PLStream/plstream.dll"
|
SHLIB_SWI_LD="\$(CC) -shared -Wl,--export-all-symbols ../../yap.dll ../../packages/PLStream/plstream.dll"
|
||||||
SHLIB_SUFFIX=".dll"
|
SHLIB_SUFFIX=".dll"
|
||||||
C_PARSER_FLAGS="$C_INTERF_FLAGS"
|
C_PARSER_FLAGS="$C_INTERF_FLAGS"
|
||||||
LDFLAGS="-Wl,--large-address-aware $LDFLAGS"
|
if test "$target_win64" = no
|
||||||
|
then
|
||||||
|
LDFLAGS="-Wl,--large-address-aware $LDFLAGS"
|
||||||
|
fi
|
||||||
EXEC_SUFFIX=".exe"
|
EXEC_SUFFIX=".exe"
|
||||||
INSTALL_DLLS=""
|
INSTALL_DLLS=""
|
||||||
DO_SECOND_LD=""
|
DO_SECOND_LD=""
|
||||||
|
25
configure.in
25
configure.in
@ -74,6 +74,9 @@ AC_ARG_ENABLE(chr,
|
|||||||
AC_ARG_ENABLE(clpqr,
|
AC_ARG_ENABLE(clpqr,
|
||||||
[ --enable-clpqr install clpqr library ],
|
[ --enable-clpqr install clpqr library ],
|
||||||
use_clpqr="$enableval", use_clpqr=yes)
|
use_clpqr="$enableval", use_clpqr=yes)
|
||||||
|
AC_ARG_ENABLE(win64,
|
||||||
|
[ --enable-win64 compile YAP for win64 ],
|
||||||
|
target_win64="$enableval", target_win64=no)
|
||||||
|
|
||||||
AC_ARG_ENABLE(april,
|
AC_ARG_ENABLE(april,
|
||||||
[ --enable-april compile Yap to support April ILP system],
|
[ --enable-april compile Yap to support April ILP system],
|
||||||
@ -513,12 +516,17 @@ then
|
|||||||
INSTALL_COMMAND=install_win32
|
INSTALL_COMMAND=install_win32
|
||||||
if test "$cygwin" = "no" -o "$target_os" = "mingw32"
|
if test "$cygwin" = "no" -o "$target_os" = "mingw32"
|
||||||
then
|
then
|
||||||
if test "$target_os" = "cygwin"
|
if test "$target_win64" = yes
|
||||||
then
|
then
|
||||||
CC="${CC} -mno-cygwin"
|
AC_CHECK_LIB(ws2_32,main)
|
||||||
CXX="${CXX} -mno-cygwin"
|
else
|
||||||
|
if test "$target_os" = "cygwin"
|
||||||
|
then
|
||||||
|
CC="${CC} -mno-cygwin"
|
||||||
|
CXX="${CXX} -mno-cygwin"
|
||||||
|
fi
|
||||||
|
AC_CHECK_LIB(wsock32,main)
|
||||||
fi
|
fi
|
||||||
AC_CHECK_LIB(wsock32,main)
|
|
||||||
AC_CHECK_LIB(psapi,main)
|
AC_CHECK_LIB(psapi,main)
|
||||||
yap_cv_readline=no
|
yap_cv_readline=no
|
||||||
if test "$prefix" = "NONE"
|
if test "$prefix" = "NONE"
|
||||||
@ -529,7 +537,7 @@ then
|
|||||||
else
|
else
|
||||||
ENABLE_WINCONSOLE="#"
|
ENABLE_WINCONSOLE="#"
|
||||||
LIBS="-lcygwin"
|
LIBS="-lcygwin"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
INSTALL_COMMAND="install_unix"
|
INSTALL_COMMAND="install_unix"
|
||||||
ENABLE_WINCONSOLE="#"
|
ENABLE_WINCONSOLE="#"
|
||||||
@ -964,7 +972,7 @@ dnl Linux has both elf and a.out, in this case we found elf
|
|||||||
# and -fomit-frame-point -DBP_FREE
|
# and -fomit-frame-point -DBP_FREE
|
||||||
JAVALIBPATH=""
|
JAVALIBPATH=""
|
||||||
JAVAINCPATH="-I\"$JAVA_HOME\"/include -I\"$JAVA_HOME\"/include/win32"
|
JAVAINCPATH="-I\"$JAVA_HOME\"/include -I\"$JAVA_HOME\"/include/win32"
|
||||||
YAPLIB="libWYap.a"
|
YAPLIB="yap.dll"
|
||||||
SHLIB_CFLAGS=""
|
SHLIB_CFLAGS=""
|
||||||
SHLIB_LD="\$(CC) -shared -Wl,--export-all-symbols ../../yap.dll"
|
SHLIB_LD="\$(CC) -shared -Wl,--export-all-symbols ../../yap.dll"
|
||||||
SHLIB_LOWER_LD="\$(CC) -shared -Wl,--export-all-symbols ../../../yap.dll"
|
SHLIB_LOWER_LD="\$(CC) -shared -Wl,--export-all-symbols ../../../yap.dll"
|
||||||
@ -972,7 +980,10 @@ dnl Linux has both elf and a.out, in this case we found elf
|
|||||||
SHLIB_SWI_LD="\$(CC) -shared -Wl,--export-all-symbols ../../yap.dll ../../packages/PLStream/plstream.dll"
|
SHLIB_SWI_LD="\$(CC) -shared -Wl,--export-all-symbols ../../yap.dll ../../packages/PLStream/plstream.dll"
|
||||||
SHLIB_SUFFIX=".dll"
|
SHLIB_SUFFIX=".dll"
|
||||||
C_PARSER_FLAGS="$C_INTERF_FLAGS"
|
C_PARSER_FLAGS="$C_INTERF_FLAGS"
|
||||||
LDFLAGS="-Wl,--large-address-aware $LDFLAGS"
|
if test "$target_win64" = no
|
||||||
|
then
|
||||||
|
LDFLAGS="-Wl,--large-address-aware $LDFLAGS"
|
||||||
|
fi
|
||||||
EXEC_SUFFIX=".exe"
|
EXEC_SUFFIX=".exe"
|
||||||
INSTALL_DLLS=""
|
INSTALL_DLLS=""
|
||||||
DO_SECOND_LD=""
|
DO_SECOND_LD=""
|
||||||
|
@ -97,10 +97,21 @@ stuff.
|
|||||||
*******************************/
|
*******************************/
|
||||||
|
|
||||||
|
|
||||||
typedef unsigned long term_t;
|
#ifdef __WINDOWS__
|
||||||
|
typedef __int64 int64_t;
|
||||||
|
typedef unsigned __int64 uint64_t;
|
||||||
|
#if (_MSC_VER < 1300)
|
||||||
|
typedef long intptr_t;
|
||||||
|
typedef unsigned long uintptr_t;
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#include <inttypes.h> /* more portable than stdint.h */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef uintptr_t term_t;
|
||||||
typedef void *module_t;
|
typedef void *module_t;
|
||||||
typedef void *record_t;
|
typedef void *record_t;
|
||||||
typedef unsigned long atom_t;
|
typedef uintptr_t atom_t;
|
||||||
typedef YAP_Term *predicate_t;
|
typedef YAP_Term *predicate_t;
|
||||||
typedef struct open_query_struct *qid_t;
|
typedef struct open_query_struct *qid_t;
|
||||||
typedef long functor_t;
|
typedef long functor_t;
|
||||||
|
@ -984,7 +984,7 @@ X_API int PL_cons_functor(term_t d, functor_t f,...)
|
|||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int arity, i;
|
int arity, i;
|
||||||
YAP_Term *tmp = (YAP_CELL *)buffers;
|
Term *tmp = (Term *)buffers;
|
||||||
Functor ff = SWIFunctorToFunctor(f);
|
Functor ff = SWIFunctorToFunctor(f);
|
||||||
|
|
||||||
if (IsAtomTerm((Term)ff)) {
|
if (IsAtomTerm((Term)ff)) {
|
||||||
|
Reference in New Issue
Block a user