python .h collision

This commit is contained in:
Vitor Santos Costa 2017-02-20 14:21:46 +00:00
parent 92e2d94186
commit a53615ceaf
34 changed files with 48 additions and 51 deletions

View File

@ -111,7 +111,7 @@ static char SccsId[] = "%W% %G%";
#include "Yap.h" #include "Yap.h"
#include "Yatom.h" #include "Yatom.h"
#include "YapHeap.h" #include "YapHeap.h"
#include "eval.h" #include "YapEval.h"

View File

@ -228,7 +228,7 @@ X is Y*10+C-48.
#include "Yap.h" #include "Yap.h"
#include "Yatom.h" #include "Yatom.h"
#include "YapHeap.h" #include "YapHeap.h"
#include "eval.h" #include "YapEval.h"
static Term static Term
float_to_int(Float v USES_REGS) float_to_int(Float v USES_REGS)

View File

@ -127,7 +127,7 @@ These are the binary numeric operators currently supported by YAP.
#include "Yap.h" #include "Yap.h"
#include "Yatom.h" #include "Yatom.h"
#include "YapHeap.h" #include "YapHeap.h"
#include "eval.h" #include "YapEval.h"
#include "arith2.h" #include "arith2.h"

View File

@ -102,7 +102,7 @@ The following predicates manipulate arrays:
#include "Yap.h" #include "Yap.h"
#include "Yatom.h" #include "Yatom.h"
#include "clause.h" #include "clause.h"
#include "eval.h" #include "YapEval.h"
#include "heapgc.h" #include "heapgc.h"
#if HAVE_ERRNO_H #if HAVE_ERRNO_H
#include <errno.h> #include <errno.h>

View File

@ -30,7 +30,7 @@ static char SccsId[] = "%W% %G%";
#ifdef USE_GMP #ifdef USE_GMP
#include "eval.h" #include "YapEval.h"
#include "alloc.h" #include "alloc.h"
Term Term

View File

@ -57,7 +57,7 @@ static char SccsId[] = "%W% %G%";
#include "Yap.h" #include "Yap.h"
#include "YapHeap.h" #include "YapHeap.h"
#include "Yatom.h" #include "Yatom.h"
#include "eval.h" #include "YapEval.h"
#if HAVE_STRING_H #if HAVE_STRING_H
#include <string.h> #include <string.h>
#endif #endif

View File

@ -174,7 +174,7 @@ static char SccsId[] = "%W% %G%";
#include "Yap.h" #include "Yap.h"
#include "alloc.h" #include "alloc.h"
#include "clause.h" #include "clause.h"
#include "compile.h" #include "YapCompile.h"
#include "yapio.h" #include "yapio.h"
#if HAVE_STRING_H #if HAVE_STRING_H
#include <string.h> #include <string.h>

View File

@ -54,13 +54,13 @@ static char SccsId[] = "%W% %G%";
/* /*
* This file includes a set of utilities, useful to the several compilation * This file includes a set of utilities, useful to the several compilation
* modules * modules
*/ */
#include "Yap.h" #include "Yap.h"
#include "Yatom.h" #include "Yatom.h"
#include "YapHeap.h" #include "YapHeap.h"
#include "compile.h" #include "YapCompile.h"
#include "yapio.h" #include "yapio.h"
#if HAVE_STRING_H #if HAVE_STRING_H
#include <string.h> #include <string.h>
@ -69,7 +69,7 @@ static char SccsId[] = "%W% %G%";
/* /*
* The compiler creates an instruction chain which will be assembled after * The compiler creates an instruction chain which will be assembled after
* afterwards * afterwards
*/ */
@ -146,7 +146,7 @@ AllocCMem (UInt size, struct intermediates *cip)
LOCAL_Error_Size = 256+((char *)cip->freep - (char *)HR); LOCAL_Error_Size = 256+((char *)cip->freep - (char *)HR);
save_machine_regs(); save_machine_regs();
siglongjmp(cip->CompilerBotch, OUT_OF_STACK_BOTCH); siglongjmp(cip->CompilerBotch, OUT_OF_STACK_BOTCH);
} }
p = cip->freep; p = cip->freep;
cip->freep += size; cip->freep += size;
return p; return p;
@ -216,7 +216,7 @@ is_a_test(Term arg, Term mod)
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
} }
return pe->PredFlags & (TestPredFlag|BinaryPredFlag); return pe->PredFlags & (TestPredFlag|BinaryPredFlag);
} }
} }
@ -315,7 +315,7 @@ Yap_emit_6ops (compiler_vm_op o, CELL r1, CELL r2, CELL r3, CELL r4, CELL r5, CE
p->rnd1 = r1; p->rnd1 = r1;
p->rnd2 = r2; p->rnd2 = r2;
p->rnd3 = r3; p->rnd3 = r3;
p->rnd4 = r4; p->rnd4 = r4;
p->rnd5 = r5; p->rnd5 = r5;
p->rnd6 = r6; p->rnd6 = r6;
p->nextInst = NIL; p->nextInst = NIL;
@ -337,7 +337,7 @@ Yap_emit_7ops (compiler_vm_op o, CELL r1, CELL r2, CELL r3, CELL r4, CELL r5, CE
p->rnd1 = r1; p->rnd1 = r1;
p->rnd2 = r2; p->rnd2 = r2;
p->rnd3 = r3; p->rnd3 = r3;
p->rnd4 = r4; p->rnd4 = r4;
p->rnd5 = r5; p->rnd5 = r5;
p->rnd6 = r6; p->rnd6 = r6;
p->rnd7 = r7; p->rnd7 = r7;
@ -520,7 +520,7 @@ write_special_label(special_label_op arg, special_label_id rn, UInt lab)
Yap_DebugErrorPuts("fail"); Yap_DebugErrorPuts("fail");
break; break;
} }
} }
} }
static void static void
@ -616,7 +616,7 @@ ShowOp (compiler_vm_op ic, const char *f, struct PSEUDO *cpc)
Yap_DebugPlWrite(MkIntegerTerm((Int)(*ptr++))); Yap_DebugPlWrite(MkIntegerTerm((Int)(*ptr++)));
} }
} }
break; break;
case 'l': case 'l':
write_address (arg); write_address (arg);
break; break;
@ -645,7 +645,7 @@ ShowOp (compiler_vm_op ic, const char *f, struct PSEUDO *cpc)
Yap_DebugPlWrite (MkIntTerm ((v->NoOfVE) & MaskVarAdrs)); Yap_DebugPlWrite (MkIntTerm ((v->NoOfVE) & MaskVarAdrs));
} }
} }
break; break;
case 'N': case 'N':
{ {
Ventry *v; Ventry *v;
@ -795,4 +795,3 @@ Yap_ShowCode (struct intermediates *cint)
} }
#endif /* DEBUG */ #endif /* DEBUG */

View File

@ -22,7 +22,7 @@ static char SccsId[] = "%W% %G%";
#include "Yap.h" #include "Yap.h"
#include "Yatom.h" #include "Yatom.h"
#include "eval.h" #include "YapEval.h"
#ifdef DEPTH_LIMIT #ifdef DEPTH_LIMIT

View File

@ -31,7 +31,7 @@ static char SccsId[] = "%W% %G%";
#include "YapHeap.h" #include "YapHeap.h"
#include "Yatom.h" #include "Yatom.h"
#include "eval.h" #include "YapEval.h"
#if HAVE_STDARG_H #if HAVE_STDARG_H
#include <stdarg.h> #include <stdarg.h>
#endif #endif

View File

@ -21,7 +21,7 @@
#include "Yap.h" #include "Yap.h"
#include "clause.h" #include "clause.h"
#include "yapio.h" #include "yapio.h"
#include "eval.h" #include "YapEval.h"
#include "tracer.h" #include "tracer.h"
#ifdef YAPOR #ifdef YAPOR
#include "or.macros.h" #include "or.macros.h"

View File

@ -20,7 +20,7 @@
#include "Yap.h" #include "Yap.h"
#include "clause.h" #include "clause.h"
#include "yapio.h" #include "yapio.h"
#include "eval.h" #include "YapEval.h"
#include "tracer.h" #include "tracer.h"
#include "attvar.h" #include "attvar.h"
#ifdef YAPOR #ifdef YAPOR

View File

@ -60,7 +60,7 @@ static Int current_prolog_flag(USES_REGS1);
static Int set_prolog_flag(USES_REGS1); static Int set_prolog_flag(USES_REGS1);
#include "Yatom.h" #include "Yatom.h"
#include "eval.h" #include "YapEval.h"
#include "yapio.h" #include "yapio.h"
#define YAP_FLAG(ID, NAME, WRITABLE, DEF, INIT, HELPER) \ #define YAP_FLAG(ID, NAME, WRITABLE, DEF, INIT, HELPER) \

View File

@ -18,7 +18,7 @@
#include "Yap.h" #include "Yap.h"
#include "Yatom.h" #include "Yatom.h"
#include "YapHeap.h" #include "YapHeap.h"
#include "eval.h" #include "YapEval.h"
#if HAVE_STRING_H #if HAVE_STRING_H
#include <string.h> #include <string.h>
#endif #endif

View File

@ -20,7 +20,7 @@
#include "yapio.h" #include "yapio.h"
#include "alloc.h" #include "alloc.h"
#include "sshift.h" #include "sshift.h"
#include "compile.h" #include "YapCompile.h"
#include "attvar.h" #include "attvar.h"
#include "cut_c.h" #include "cut_c.h"
#if HAVE_STRING_H #if HAVE_STRING_H

View File

@ -634,7 +634,7 @@ type_of_verb(rest,passive).
*/ */
#include "absmi.h" #include "absmi.h"
#include "compile.h" #include "YapCompile.h"
#if DEBUG #if DEBUG
#include "yapio.h" #include "yapio.h"
#endif #endif

View File

@ -48,7 +48,7 @@ deterministic computations.
#include "Yatom.h" #include "Yatom.h"
#include "YapHeap.h" #include "YapHeap.h"
#include "eval.h" #include "YapEval.h"
static Int p_setarg( USES_REGS1 ); static Int p_setarg( USES_REGS1 );
static Int p_create_mutable( USES_REGS1 ); static Int p_create_mutable( USES_REGS1 );

View File

@ -141,7 +141,7 @@ dot with single quotes.
#include "YapHeap.h" #include "YapHeap.h"
#include "YapText.h" #include "YapText.h"
#include "Yatom.h" #include "Yatom.h"
#include "eval.h" #include "YapEval.h"
#include "yapio.h" #include "yapio.h"
/* stuff we want to use in standard YAP code */ /* stuff we want to use in standard YAP code */
#include "iopreds.h" #include "iopreds.h"

View File

@ -21,7 +21,7 @@ static char SccsId[] = "%W% %G%";
#include "Yap.h" #include "Yap.h"
#include "Yatom.h" #include "Yatom.h"
#include "YapHeap.h" #include "YapHeap.h"
#include "eval.h" #include "YapEval.h"
static Int static Int
p_in_range( USES_REGS1 ) { p_in_range( USES_REGS1 ) {

View File

@ -407,7 +407,7 @@ writing, writing a BOM can be requested using the option
#include "YapHeap.h" #include "YapHeap.h"
#include "Yatom.h" #include "Yatom.h"
#include "alloc.h" #include "alloc.h"
#include "eval.h" #include "YapEval.h"
#include "yapio.h" #include "yapio.h"
/* stuff we want to use in standard YAP code */ /* stuff we want to use in standard YAP code */
#include "YapText.h" #include "YapText.h"

View File

@ -30,7 +30,7 @@ static char SccsId[] = "%W% %G%";
#endif #endif
#include "YapHeap.h" #include "YapHeap.h"
#include "Yatom.h" #include "Yatom.h"
#include "eval.h" #include "YapEval.h"
#include "yapio.h" #include "yapio.h"
#ifdef TABLING #ifdef TABLING
#include "tab.macros.h" #include "tab.macros.h"

View File

@ -30,7 +30,7 @@
#include "Yap.h" #include "Yap.h"
#include "clause.h" #include "clause.h"
#include "eval.h" #include "YapEval.h"
#include "iopreds.h" #include "iopreds.h"
#include "tracer.h" #include "tracer.h"
#include "yapio.h" #include "yapio.h"

View File

@ -31,7 +31,7 @@
#include "Yap.h" #include "Yap.h"
#include "clause.h" #include "clause.h"
#include "yapio.h" #include "yapio.h"
#include "eval.h" #include "YapEval.h"
#include "tracer.h" #include "tracer.h"
#ifdef YAPOR #ifdef YAPOR
#include "or.macros.h" #include "or.macros.h"

View File

@ -37,7 +37,7 @@ static char SccsId[] = "%W% %G%";
#include "Foreign.h" #include "Foreign.h"
#include "YapHeap.h" #include "YapHeap.h"
#include "Yatom.h" #include "Yatom.h"
#include "eval.h" #include "YapEval.h"
#include "yapio.h" #include "yapio.h"
#ifdef TABLING #ifdef TABLING
#include "tab.macros.h" #include "tab.macros.h"

View File

@ -16,10 +16,10 @@
*************************************************************************/ *************************************************************************/
#include "Yap.h" #include "Yap.h"
#include "YapEval.h"
#include "YapHeap.h" #include "YapHeap.h"
#include "YapText.h" #include "YapText.h"
#include "Yatom.h" #include "Yatom.h"
#include "eval.h"
#include "yapio.h" #include "yapio.h"
#include <YapText.h> #include <YapText.h>

View File

@ -26,7 +26,7 @@ static char SccsId[] = "%W% %G%";
#include "Yap.h" #include "Yap.h"
#include "Yatom.h" #include "Yatom.h"
#include "YapHeap.h" #include "YapHeap.h"
#include "eval.h" #include "YapEval.h"
#include "yapio.h" #include "yapio.h"
#include "blobs.h" #include "blobs.h"
#include <stdio.h> #include <stdio.h>

View File

@ -61,7 +61,7 @@ static char SccsId[] = "%W% %G%";
#include "Yatom.h" #include "Yatom.h"
#include "YapHeap.h" #include "YapHeap.h"
#include "yapio.h" #include "yapio.h"
#include "eval.h" #include "YapEval.h"
#include "YapText.h" #include "YapText.h"
#include <stdlib.h> #include <stdlib.h>
#if HAVE_STDARG_H #if HAVE_STDARG_H

View File

@ -74,7 +74,7 @@ static char SccsId[] = "%W% %G%";
#define S_ISDIR(x) (((x)&_S_IFDIR) == _S_IFDIR) #define S_ISDIR(x) (((x)&_S_IFDIR) == _S_IFDIR)
#endif #endif
#endif #endif
#include "eval.h" #include "YapEval.h"
#include "iopreds.h" #include "iopreds.h"
static Int p_change_type_of_char(USES_REGS1); static Int p_change_type_of_char(USES_REGS1);

View File

@ -263,7 +263,7 @@ output is directed to the stream used by format/2.
#endif #endif
#endif #endif
#include "eval.h" #include "YapEval.h"
#include "iopreds.h" #include "iopreds.h"
#include "format.h" #include "format.h"

View File

@ -36,7 +36,7 @@ static char SccsId[] = "%W% %G%";
#include "YapHeap.h" #include "YapHeap.h"
#include "YapText.h" #include "YapText.h"
#include "Yatom.h" #include "Yatom.h"
#include "eval.h" #include "YapEval.h"
#include "yapio.h" #include "yapio.h"
#include <stdlib.h> #include <stdlib.h>
#if HAVE_UNISTD_H #if HAVE_UNISTD_H

View File

@ -32,7 +32,7 @@ static char SccsId[] = "%W% %G%";
#include "YapHeap.h" #include "YapHeap.h"
#include "YapText.h" #include "YapText.h"
#include "Yatom.h" #include "Yatom.h"
#include "eval.h" #include "YapEval.h"
#include "yapio.h" #include "yapio.h"
#include <stdlib.h> #include <stdlib.h>
#if HAVE_STDARG_H #if HAVE_STDARG_H

View File

@ -65,7 +65,7 @@ void Yap_WinError(char *yap_error) {
/* Error, we could not read time */ /* Error, we could not read time */
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
msg, 256, NULL); msg, 255, NULL);
Yap_Error(SYSTEM_ERROR_OPERATING_SYSTEM, TermNil, "%s at %s", msg, yap_error); Yap_Error(SYSTEM_ERROR_OPERATING_SYSTEM, TermNil, "%s at %s", msg, yap_error);
} }
#endif /* __WINDOWS__ */ #endif /* __WINDOWS__ */
@ -81,7 +81,7 @@ static bool is_directory(const char *FileName) {
if ((vfs = vfs_owner(FileName))) { if ((vfs = vfs_owner(FileName))) {
return vfs->isdir(vfs, FileName); return vfs->isdir(vfs, FileName);
} }
#ifdef __WINDOWS__ #ifdef _WIN32
DWORD dwAtts = GetFileAttributes(FileName); DWORD dwAtts = GetFileAttributes(FileName);
if (dwAtts == INVALID_FILE_ATTRIBUTES) if (dwAtts == INVALID_FILE_ATTRIBUTES)
return false; return false;
@ -952,15 +952,15 @@ static bool initSysPath(Term tlib, Term tcommons, bool dir_done,
{ {
char *dir; char *dir;
if ((dir = Yap_RegistryGetString("library")) && is_directory(dir)) { if ((dir = Yap_RegistryGetString("library")) && is_directory(dir)) {
dir_done = true;
if (!Yap_unify(tlib, MkAtomTerm(Yap_LookupAtom(dir)))) if (!Yap_unify(tlib, MkAtomTerm(Yap_LookupAtom(dir))))
return FALSE; return FALSE;
} }
dir_done = true;
if ((dir = Yap_RegistryGetString("prolog_commons")) && is_directory(dir)) { if ((dir = Yap_RegistryGetString("prolog_commons")) && is_directory(dir)) {
if (!Yap_unify(tcommons, MkAtomTerm(Yap_LookupAtom(dir)))) if (!Yap_unify(tcommons, MkAtomTerm(Yap_LookupAtom(dir))))
return FALSE; return FALSE;
commons_done = true;
} }
commons_done = true;
} }
if (dir_done && commons_done) if (dir_done && commons_done)
return TRUE; return TRUE;
@ -1199,9 +1199,7 @@ const char *Yap_findFile(const char *isource, const char *idef,
source = (isource ? isource : idef); source = (isource ? isource : idef);
} }
if (source) { if (source) {
if (source[0] == '/') { abspath = Yap_IsAbsolutePath(source);
abspath = true;
}
} }
if (!abspath && !root && ftype == YAP_BOOT_PL) { if (!abspath && !root && ftype == YAP_BOOT_PL) {
root = YAP_PL_SRCDIR; root = YAP_PL_SRCDIR;
@ -1251,7 +1249,7 @@ const char *Yap_findFile(const char *isource, const char *idef,
break; break;
case 4: // WIN stuff: registry case 4: // WIN stuff: registry
#if __WINDOWS__ #if __WINDOWS
if (in_lib) { if (in_lib) {
source = (ftype == YAP_PL || ftype == YAP_QLY ? "library" : "startup"); source = (ftype == YAP_PL || ftype == YAP_QLY ? "library" : "startup");
source = Yap_RegistryGetString(source); source = Yap_RegistryGetString(source);

View File

@ -25,7 +25,7 @@
#include "YapHeap.h" #include "YapHeap.h"
#include "YapText.h" #include "YapText.h"
#include "Yatom.h" #include "Yatom.h"
#include "eval.h" #include "YapEval.h"
#include "yapio.h" #include "yapio.h"
// Win32 InputOutput Support // Win32 InputOutput Support

View File

@ -28,7 +28,7 @@ static char SccsId[] = "%W% %G%";
#include "YapHeap.h" #include "YapHeap.h"
#include "YapText.h" #include "YapText.h"
#include "Yatom.h" #include "Yatom.h"
#include "eval.h" #include "YapEval.h"
#include "yapio.h" #include "yapio.h"
#include <stdlib.h> #include <stdlib.h>
#if HAVE_STDARG_H #if HAVE_STDARG_H