make it compile under MSN vc. Unfortunately it has a weird crash at boot :(

- Lots of indenting changes
- VC++ is strict with variadic macros
- VC++ does not accept unistd.h
- new interface for walltime
- VC++ does not seem to have support for integer overflow.
- VC++ defines YENV_REG?
- no access flags, x permissions ignored.
- new FindGMP supporting MPIR
- make horus optional (c++ is hard).
This commit is contained in:
Vítor Santos Costa
2016-02-28 19:32:55 +00:00
parent 56e9a8f8d9
commit 2192f73b11
84 changed files with 2717 additions and 2737 deletions

View File

@@ -562,62 +562,62 @@ Yap_OpPropForModule(Atom a,
return info;
}
static OpEntry *
fetchOpWithModule( PropEntry *pp, Term tmod, op_type type )
{
OpEntry *
Yap_GetOpProp(Atom a,
op_type type
USES_REGS) { /* look property list of atom a for kind */
AtomEntry *ae = RepAtom(a);
PropEntry *pp;
OpEntry *oinfo = NULL;
READ_LOCK(ae->ARWLock);
pp = RepProp(ae->PropsOfAE);
while (!EndOfPAEntr(pp)) {
OpEntry *info = NULL;
if (pp->KindOfPE != OpProperty) {
pp = RepProp(pp->NextOfPE);
continue;
}
info = (OpEntry *)pp;
if (info->OpModule != tmod) {
if (info->OpModule != CurrentModule && info->OpModule != PROLOG_MODULE) {
pp = RepProp(pp->NextOfPE);
continue;
}
if (type == INFIX_OP) {
if (!info->Infix) {
return NULL;
pp = RepProp(pp->NextOfPE);
continue;
}
} else if (type == POSFIX_OP) {
if (!info->Posfix) {
return NULL;
pp = RepProp(pp->NextOfPE);
continue;
}
} else {
if (!info->Prefix) {
return NULL;
pp = RepProp(pp->NextOfPE);
continue;
}
}
return info;
/* if it is not the latest module */
if (info->OpModule == PROLOG_MODULE) {
/* cannot commit now */
oinfo = info;
pp = RepProp(pp->NextOfPE);
} else {
READ_LOCK(info->OpRWLock);
READ_UNLOCK(ae->ARWLock);
return info;
}
}
if (oinfo) {
READ_LOCK(oinfo->OpRWLock);
READ_UNLOCK(ae->ARWLock);
return oinfo;
}
READ_UNLOCK(ae->ARWLock);
return NULL;
}
OpEntry *
Yap_GetOpProp(Atom a,
op_type type,
Term tmod
USES_REGS) { /* look property list of atom a for kind */
AtomEntry *ae = RepAtom(a);
PropEntry *pp;
OpEntry *info;
READ_LOCK(ae->ARWLock);
pp = RepProp(ae->PropsOfAE);
if (( (info = fetchOpWithModule( pp, tmod, type )) != NULL) ||
( (info = fetchOpWithModule( pp, USER_MODULE, type )) != NULL) ||
( (info = fetchOpWithModule( pp, PROLOG_MODULE, type )) != NULL)
) {
LOCK(info->OpRWLock);
return info;
READ_UNLOCK(ae->ARWLock);
}
READ_UNLOCK(ae->ARWLock);
return NULL;
}
inline static Prop GetPredPropByAtomHavingLock(AtomEntry *ae, Term cur_mod)
/* get predicate entry for ap/arity; create it if neccessary. */