upgrade to latest swi

This commit is contained in:
Vitor Santos Costa
2013-11-15 01:10:25 +00:00
parent 5b46b6bd1a
commit 4e4f21e1dc
49 changed files with 6726 additions and 3043 deletions

View File

@@ -97,6 +97,28 @@ PL_get_intptr_ex(term_t t, intptr_t *i)
}
int
PL_get_size_ex(term_t t, size_t *i)
{ int64_t val;
if ( !PL_get_int64_ex(t, &val) )
fail;
if ( val < 0 )
return PL_error(NULL, 0, NULL, ERR_DOMAIN,
ATOM_not_less_than_zero, t);
#if SIZEOF_VOIDP < 8
#if SIZEOF_LONG == SIZEOF_VOIDP
if ( val > (int64_t)ULONG_MAX )
return PL_error(NULL, 0, NULL, ERR_REPRESENTATION, ATOM_size_t);
#endif
#endif
*i = (size_t)val;
return TRUE;
}
int
PL_get_bool_ex(term_t t, int *i)
{ if ( PL_get_bool(t, i) )
@@ -268,6 +290,11 @@ PL_resource_error(const char *resource)
return rc;
}
int
PL_no_memory(void)
{ return PL_error(NULL, 0, NULL, ERR_RESOURCE, ATOM_memory);
}
word
@@ -275,7 +302,7 @@ notImplemented(char *name, int arity)
{ return (word)PL_error(NULL, 0, NULL, ERR_NOT_IMPLEMENTED_PROC, name, arity);
}
X_API int PL_error(const char *pred, int arity, const char *msg, int id, ...)
int PL_error(const char *pred, int arity, const char *msg, PL_error_code id, ...)
{
GET_LD
char msgbuf[50];