Merge branch 'master' of yap.dcc.fc.up.pt:yap-6

Conflicts:
	include/SWI-Prolog.h
This commit is contained in:
Vítor Santos Costa 2010-07-21 09:44:18 +01:00
commit 1f3455a656
16 changed files with 68 additions and 31 deletions

View File

@ -3618,9 +3618,9 @@ void Yap_InitUtilCPreds(void)
Yap_InitCPred("term_hash", 4, p_term_hash, SafePredFlag);
Yap_InitCPred("instantiated_term_hash", 4, p_instantiated_term_hash, SafePredFlag);
Yap_InitCPred("variant", 2, p_variant, 0);
Yap_InitCPred("subsumes", 2, p_subsumes, SafePredFlag);
Yap_InitCPred("variables_within_term", 3, p_variables_within_term, 3);
Yap_InitCPred("new_variables_in_term", 3, p_new_variables_in_term, 3);
Yap_InitCPred("subsumes", 2, p_subsumes, 0);
Yap_InitCPred("variables_within_term", 3, p_variables_within_term, 0);
Yap_InitCPred("new_variables_in_term", 3, p_new_variables_in_term, 0);
CurrentModule = cm;
#ifdef DEBUG
Yap_InitCPred("$force_trail_expansion", 1, p_force_trail_expansion, SafePredFlag|HiddenPredFlag);

2
LGPL/swi_console/console.c Normal file → Executable file
View File

@ -88,7 +88,7 @@ static void initHeapDebug(void);
#define UNICODE_NOCHAR 0xFFFF
#endif
#if (_MSC_VER < 1400)
#if (_MSC_VER < 1400) && !_WIN64
typedef DWORD DWORD_PTR;
#endif

View File

@ -598,6 +598,7 @@ install_win32: startup.yss
$(INSTALL) parms.h $(DESTDIR)$(INCLUDEDIR)/parms.h
(cd packages/PLStream; $(MAKE) install)
(cd packages/tai; $(MAKE) install)
(cd packages/clib; $(MAKE) install)
(cd packages/plunit; $(MAKE) install)
(cd packages/http; $(MAKE) install)
(cd packages/sgml; $(MAKE) install)

View File

@ -115,6 +115,10 @@
#undef HAVE_WINSOCK_H
#undef HAVE_WINSOCK2_H
#if __MINGW32__
#define __WINDOWS__ 1
#endif
/* Do we have restartable syscalls */
#undef HAVE_RESTARTABLE_SYSCALLS

23
configure vendored
View File

@ -5189,8 +5189,10 @@ fi
if test "$target_win64" = yes
then
prefix="\${SYSTEMDRIVE}/Yap64"
CLIB_NETLIBS="-lwsock32 -lpsapi -lgdi32"
else
prefix="\${SYSTEMDRIVE}/Yap"
CLIB_NETLIBS="-lws2_32 -lpsapi -lgdi32"
fi
fi
ENABLE_WINCONSOLE=""
@ -9273,14 +9275,14 @@ CHR_TARGETS=chr_support."$SO"
CLIB_TARGETS="random.$SO socket.$SO cgi.$SO memfile.$SO files.$SO mime.$SO crypt.$SO"
CLIB_PLTARGETS="\$(srcdir)/random.pl \$(srcdir)/socket.pl \$(srcdir)/cgi.pl \$(srcdir)/memfile.pl \$(srcdir)/filesex.pl \$(srcdir)/mime.pl \$(srcdir)/crypt.pl"
CLIB_TARGETS="random.$SO unix.$SO socket.$SO cgi.$SO memfile.$SO files.$SO mime.$SO crypt.$SO"
CLIB_PLTARGETS="\$(srcdir)/random.pl \$(srcdir)/unix.pl \$(srcdir)/socket.pl \$(srcdir)/cgi.pl \$(srcdir)/memfile.pl \$(srcdir)/filesex.pl \$(srcdir)/mime.pl \$(srcdir)/crypt.pl"
if test "$IN_UNIX" = ""; then
CLIB_TARGETS="unix.$SO $CLIB_TARGETS"
CLIB_PLTARGETS="\$(srcdir)/unix.pl $CLIB_PLTARGETS"
CLIB_NETLIBS=
else
ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket"
if test "x$ac_cv_func_socket" = x""yes; then :
@ -9381,6 +9383,8 @@ fi
fi
fi
oldlibs="$LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5
@ -9442,6 +9446,11 @@ done
LIBS="$oldlibs"
ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
#include <sys/types.h>
#include <sys/socket.h>

View File

@ -570,8 +570,10 @@ then
if test "$target_win64" = yes
then
prefix="\${SYSTEMDRIVE}/Yap64"
CLIB_NETLIBS="-lwsock32 -lpsapi -lgdi32"
else
prefix="\${SYSTEMDRIVE}/Yap"
CLIB_NETLIBS="-lws2_32 -lpsapi -lgdi32"
fi
fi
ENABLE_WINCONSOLE=""
@ -1726,14 +1728,14 @@ AC_SUBST(TARGETS)
AC_SUBST(PLTARGETS)
AC_SUBST(CHR_TARGETS)
AC_SUBST(CLIB_TARGETS)
AC_SUBST(CLIB_PLTARGETS)
AC_SUBST(CLIB_NETLIBS)
AC_SUBST(CLIB_CRYPTLIBS)
CLIB_TARGETS="random.$SO unix.$SO socket.$SO cgi.$SO memfile.$SO files.$SO mime.$SO crypt.$SO"
CLIB_PLTARGETS="\$(srcdir)/random.pl \$(srcdir)/unix.pl \$(srcdir)/socket.pl \$(srcdir)/cgi.pl \$(srcdir)/memfile.pl \$(srcdir)/filesex.pl \$(srcdir)/mime.pl \$(srcdir)/crypt.pl"
CLIB_TARGETS="random.$SO socket.$SO cgi.$SO memfile.$SO files.$SO mime.$SO crypt.$SO"
CLIB_PLTARGETS="\$(srcdir)/random.pl \$(srcdir)/socket.pl \$(srcdir)/cgi.pl \$(srcdir)/memfile.pl \$(srcdir)/filesex.pl \$(srcdir)/mime.pl \$(srcdir)/crypt.pl"
if test "$IN_UNIX" = ""; then
CLIB_TARGETS="unix.$SO $CLIB_TARGETS"
CLIB_PLTARGETS="\$(srcdir)/unix.pl $CLIB_PLTARGETS"
CLIB_NETLIBS=
else
AC_CHECK_FUNC(socket, [], [
AC_CHECK_LIB(socket, socket,
[CLIB_NETLIBS="$CLIB_NETLIBS -lsocket"]
@ -1744,6 +1746,8 @@ AC_CHECK_FUNC(gethostent, [], [
[CLIB_NETLIBS="$CLIB_NETLIBS -lnsl"]
AC_DEFINE(HAVE_LIBNSL, 1,
"Define if you have the nsl library (-lnsl)."))])
fi
oldlibs="$LIBS"
AC_CHECK_LIB(crypt, crypt)
@ -1751,6 +1755,11 @@ CRYPTLIBS="$LIBS"
AC_CHECK_FUNCS(crypt)
LIBS="$oldlibs"
AC_SUBST(CLIB_TARGETS)
AC_SUBST(CLIB_PLTARGETS)
AC_SUBST(CLIB_NETLIBS)
AC_SUBST(CLIB_CRYPTLIBS)
AC_CHECK_TYPES(socklen_t, [], [],
[
#include <sys/types.h>

View File

@ -111,12 +111,15 @@ stuff.
#ifdef __WINDOWS__
#ifndef INT64_T_DEFINED
#define INT64_T_DEFINED 1
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#if (_MSC_VER < 1300)
#if (_MSC_VER < 1300) && !defined(__MINGW32__)
typedef long intptr_t;
typedef unsigned long uintptr_t;
#endif
#endif
#else
#include <inttypes.h> /* more portable than stdint.h */
#endif
@ -131,12 +134,7 @@ typedef uintptr_t functor_t;
typedef int (*PL_agc_hook_t)(atom_t);
typedef unsigned long foreign_t; /* return type of foreign functions */
typedef wchar_t pl_wchar_t; /* wide character support */
#ifdef WIN32
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <inttypes.h> /* more portable than stdint.h */
#endif
#if !defined(_MSC_VER)
typedef uintptr_t PL_fid_t; /* opaque foreign context handle */
#endif

View File

@ -46,12 +46,16 @@
#include <wchar.h>
#include <stddef.h>
#ifdef __WINDOWS__
#ifndef INT64_T_DEFINED
#define INT64_T_DEFINED 1
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#if (_MSC_VER < 1300) && !defined(__MINGW32__)
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef intptr_t ssize_t; /* signed version of size_t */
#endif
#endif
#else
#include <unistd.h>
#include <inttypes.h> /* more portable than stdint.h */
@ -207,7 +211,7 @@ PL_EXPORT(IOSTREAM *) S__getiob(void); /* get DLL's __iob[] address */
PL_EXPORT_DATA(IOFUNCTIONS) Sfilefunctions; /* OS file functions */
PL_EXPORT_DATA(int) Slinesize; /* Sgets() linesize */
#if defined(__CYGWIN__) && !defined(PL_KERNEL)
#if (defined(__CYGWIN__) || defined(__MINGW32__)) && !defined(PL_KERNEL)
#define S__iob S__getiob()
#else
PL_EXPORT_DATA(IOSTREAM) S__iob[3]; /* Libs standard streams */

0
packages/PLStream/pl-stream.c Normal file → Executable file
View File

4
packages/clib/Makefile.in Normal file → Executable file
View File

@ -36,7 +36,7 @@ MKINDEX=true
NETLIBS=@CLIB_NETLIBS@
CRYPTLIBS=@CLIB_CRYPTLIBS@
LD=@DO_SECOND_LD@ @SHLIB_CXX_LD@
LD=@DO_SECOND_LD@ @SHLIB_LD@
LDFLAGS=@EXTRA_LIBS_FOR_SWIDLLS@
BINTARGET=$(DESTDIR)$(YAPLIBDIR)
@ -105,7 +105,7 @@ TARGETS= @CLIB_TARGETS@ readutil.@SO@ streaminfo.@SO@ process.@SO@ \
UNXOBJ= error.o unix.o
SOCKOBJ= error.o socket.o nonblockio.o
CGIOBJ= error.o form.o cgi.o
CRYPTOBJ= error.o crypt.o md5.o md5passwd.o
CRYPTOBJ= error.o crypt.o md5.o md5passwd.o @ENABLE_WINCONSOLE@ bsd-crypt.o
MEMOBJ= error.o memfile.o
MIMEOBJ= error.o mime.o
TIMEOBJ= error.o time.o

2
packages/clib/bsd-crypt.c Normal file → Executable file
View File

@ -33,6 +33,8 @@
*/
/* JW: Added to make this file compile as-is for SWI-Prolog */
#include <SWI-Prolog.h>
#define __RCSID(s) static char sccsid[] = s
#define DES_ONLY
#define CRYPT_ONLY

10
packages/clib/nonblockio.c Normal file → Executable file
View File

@ -823,13 +823,21 @@ socket_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
for(i=0; i<n; i++)
{ if ( s[i] )
{ __try
{
#if __MINGW32__
{ if ( s[i]->magic != PLSOCK_MAGIC )
{ goto nosocket;
}
}
#else
__try
{ if ( s[i]->magic != PLSOCK_MAGIC )
{ goto nosocket;
}
} __except(EXCEPTION_EXECUTE_HANDLER)
{ goto nosocket;
}
#endif
doRequest(s[i]);
}

2
packages/clib/process.c Normal file → Executable file
View File

@ -150,7 +150,9 @@ resource_error(const char *resource)
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
#ifndef __MINGW32__
typedef DWORD pid_t;
#endif
typedef wchar_t echar; /* environment character */
#else
typedef char echar;

2
packages/clib/unix.c Normal file → Executable file
View File

@ -30,7 +30,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/types.h>u
#include <sys/wait.h>
#include <fcntl.h>
#include <assert.h>

@ -1 +1 @@
Subproject commit daedb37386cd9cdebd1473eed60d9bf240379d81
Subproject commit 7c9456b5c9c60ab227674f7653dc226e13973484

View File

@ -107,7 +107,7 @@ value is EAST and includes the DST offset.
static int
tz_offset()
{
#ifdef HAVE_VAR_TIMEZONE
#if defined(HAVE_VAR_TIMEZONE) || _WIN64
do_tzset();
return timezone;
#else