From 3801508cdf7f6a92be0e07732e521c01fef3106b Mon Sep 17 00:00:00 2001 From: vsc Date: Fri, 23 Jul 2004 21:08:45 +0000 Subject: [PATCH] windows fixes git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1103 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/absmi.c | 12 ++++++++++-- C/alloc.c | 4 ++-- C/stdpreds.c | 11 +++++++++-- C/unify.c | 4 ++-- library/Tries/yap_tries.c | 23 +++++++++++++++++++++++ m4/Yap.h.m4 | 4 ++-- 6 files changed, 48 insertions(+), 10 deletions(-) diff --git a/C/absmi.c b/C/absmi.c index 4fc9f3b02..3b0cfd555 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -10,8 +10,14 @@ * * * File: absmi.c * * comments: Portable abstract machine interpreter * -* Last rev: $Date: 2004-07-22 21:32:20 $,$Author: vsc $ * +* Last rev: $Date: 2004-07-23 21:08:44 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.140 2004/07/22 21:32:20 vsc +* debugger fixes +* initial support for JPL +* bad calls to garbage collector and gc +* debugger fixes +* * Revision 1.139 2004/07/03 03:29:24 vsc * make it compile again on non-linux machines * @@ -11960,8 +11966,10 @@ Yap_absmi(int inp) } +int STD_PROTO(Yap_absmiEND,(void)); + /* dummy function that is needed for profiler */ -int Yap_absmiEND() +int Yap_absmiEND(void) { return 1; } diff --git a/C/alloc.c b/C/alloc.c index 5a24445d9..379172bdd 100644 --- a/C/alloc.c +++ b/C/alloc.c @@ -12,7 +12,7 @@ * Last rev: * * mods: * * comments: allocating space * -* version:$Id: alloc.c,v 1.53 2004-07-23 19:02:09 vsc Exp $ * +* version:$Id: alloc.c,v 1.54 2004-07-23 21:08:44 vsc Exp $ * *************************************************************************/ #ifdef SCCS static char SccsId[] = "%W% %G%"; @@ -603,7 +603,7 @@ InitWorkSpace(Int s) Yap_Error(FATAL_ERROR,TermNil,"VirtualAlloc failed"); return(0); } - fprintf(stderr,"% Warning: YAP reserving space at variable address %p\n", b); + fprintf(stderr,"%% Warning: YAP reserving space at variable address %p\n", b); } brk = BASE_ADDRESS; diff --git a/C/stdpreds.c b/C/stdpreds.c index 7622d3250..7f9d4f4d9 100644 --- a/C/stdpreds.c +++ b/C/stdpreds.c @@ -11,8 +11,15 @@ * File: stdpreds.c * * comments: General-purpose C implemented system predicates * * * -* Last rev: $Date: 2004-06-29 19:04:42 $,$Author: vsc $ * +* Last rev: $Date: 2004-07-23 21:08:44 $,$Author: vsc $ * * $Log: not supported by cvs2svn $ +* Revision 1.70 2004/06/29 19:04:42 vsc +* fix multithreaded version +* include new version of Ricardo's profiler +* new predicat atomic_concat +* allow multithreaded-debugging +* small fixes +* * Revision 1.69 2004/06/16 14:12:53 vsc * miscellaneous fixes * @@ -1163,7 +1170,7 @@ p_atomic_concat(void) #if HAVE_SNPRINTF snprintf(cptr, (top-cptr)-1024,"%ld", (long int)IntegerOfTerm(thead)); #else - sprintf(cptr,"%ld", IntegerOfTerm(thead)); + sprintf(cptr,"%ld", (long int)IntegerOfTerm(thead)); #endif while (*cptr && cptr < top-1024) cptr++; } else if (IsFloatTerm(thead)) { diff --git a/C/unify.c b/C/unify.c index 5b9500d68..e0bb0e85e 100644 --- a/C/unify.c +++ b/C/unify.c @@ -26,7 +26,7 @@ STATIC_PROTO(int rtable_hash_op, (OPCODE)); STATIC_PROTO(void InitReverseLookupOpcode, (void)); #endif -int +static int rational_tree_loop(CELL *pt0, CELL *pt0_end, CELL **to_visit0) { CELL **to_visit = to_visit0; @@ -115,7 +115,7 @@ rational_tree(Term d0) { Functor f = (Functor)(*pt0); CELL **to_visit = (CELL **)H; - return(rational_tree_loop(pt0, pt0+ArityOfFunctor(f), to_visit)); + return rational_tree_loop(pt0, pt0+ArityOfFunctor(f), to_visit); } else return(FALSE); } diff --git a/library/Tries/yap_tries.c b/library/Tries/yap_tries.c index 141e6a769..d8796f877 100644 --- a/library/Tries/yap_tries.c +++ b/library/Tries/yap_tries.c @@ -276,3 +276,26 @@ static int p_print_trie(void) { print_trie((TrNode) YAP_IntOfTerm(arg_trie)); return TRUE; } + +#ifdef _WIN32 + +#include + +int WINAPI PROTO(win_tries, (HANDLE, DWORD, LPVOID)); + +int WINAPI win_tries(HANDLE hinst, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + break; + case DLL_PROCESS_DETACH: + break; + case DLL_THREAD_ATTACH: + break; + case DLL_THREAD_DETACH: + break; + } + return 1; +} +#endif diff --git a/m4/Yap.h.m4 b/m4/Yap.h.m4 index f22e042b6..ac73331c3 100644 --- a/m4/Yap.h.m4 +++ b/m4/Yap.h.m4 @@ -10,7 +10,7 @@ * File: Yap.h.m4 * * mods: * * comments: main header file for YAP * -* version: $Id: Yap.h.m4,v 1.59 2004-07-15 15:47:08 vsc Exp $ * +* version: $Id: Yap.h.m4,v 1.60 2004-07-23 21:08:45 vsc Exp $ * *************************************************************************/ #include "config.h" @@ -233,7 +233,7 @@ typedef long int YAP_LONG_LONG; typedef unsigned long int YAP_ULONG_LONG; #endif -#if HAVE_SIGPROF +#if HAVE_SIGPROF && __linux__ #define LOW_PROF 1 #endif