add address_bits flag (request from Paulo Moura).
This commit is contained in:
parent
f3c2dea752
commit
83f25afc41
11
C/sysbits.c
11
C/sysbits.c
@ -2972,6 +2972,16 @@ p_ld_path(void)
|
|||||||
return Yap_unify(ARG1,MkAtomTerm(Yap_LookupAtom(YAP_LIBDIR)));
|
return Yap_unify(ARG1,MkAtomTerm(Yap_LookupAtom(YAP_LIBDIR)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Int
|
||||||
|
p_address_bits(void)
|
||||||
|
{
|
||||||
|
#if SIZEOF_INT_P==4
|
||||||
|
return Yap_unify(ARG1,MkIntTerm(32));
|
||||||
|
#else
|
||||||
|
return Yap_unify(ARG1,MkIntTerm(64));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -3193,6 +3203,7 @@ Yap_InitSysPreds(void)
|
|||||||
Yap_InitCPred ("$unix", 0, p_unix, SafePredFlag);
|
Yap_InitCPred ("$unix", 0, p_unix, SafePredFlag);
|
||||||
Yap_InitCPred ("$win32", 0, p_win32, SafePredFlag);
|
Yap_InitCPred ("$win32", 0, p_win32, SafePredFlag);
|
||||||
Yap_InitCPred ("$ld_path", 1, p_ld_path, SafePredFlag);
|
Yap_InitCPred ("$ld_path", 1, p_ld_path, SafePredFlag);
|
||||||
|
Yap_InitCPred ("$address_bits", 1, p_address_bits, SafePredFlag);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
Yap_InitCPred ("win_registry_get_value", 3, p_win_registry_get_value,0);
|
Yap_InitCPred ("win_registry_get_value", 3, p_win_registry_get_value,0);
|
||||||
#endif
|
#endif
|
||||||
|
@ -876,10 +876,20 @@ yap_flag(max_threads,X) :-
|
|||||||
yap_flag(max_threads,X) :-
|
yap_flag(max_threads,X) :-
|
||||||
'$do_error'(domain_error(flag_value,max_threads+X),yap_flag(max_threads,X)).
|
'$do_error'(domain_error(flag_value,max_threads+X),yap_flag(max_threads,X)).
|
||||||
|
|
||||||
|
yap_flag(address_bits,X) :-
|
||||||
|
var(X), !,
|
||||||
|
'$address_bits'(X).
|
||||||
|
yap_flag(address_bits,X) :-
|
||||||
|
integer(X), X > 0, !,
|
||||||
|
'$do_error'(permission_error(modify,flag,address_bits),yap_flag(address_bits,X)).
|
||||||
|
yap_flag(address_bits,X) :-
|
||||||
|
'$do_error'(domain_error(flag_value,address_bits+X),yap_flag(address_bits,X)).
|
||||||
|
|
||||||
yap_flag(dialect,yap).
|
yap_flag(dialect,yap).
|
||||||
|
|
||||||
'$show_yap_flag_opts'(V,Out) :-
|
'$show_yap_flag_opts'(V,Out) :-
|
||||||
(
|
(
|
||||||
|
V = address_bits ;
|
||||||
V = answer_format ;
|
V = answer_format ;
|
||||||
V = argv ;
|
V = argv ;
|
||||||
V = bounded ;
|
V = bounded ;
|
||||||
|
Reference in New Issue
Block a user