WIN32 patches

This commit is contained in:
U-WIN-ENP104VVO3U\Vítor Santos Costa 2011-03-21 17:07:58 +00:00
parent 417bbd6d46
commit 7670ce631b
18 changed files with 2296 additions and 2175 deletions

View File

@ -862,7 +862,7 @@ ExtendWorkSpace(Int s, int fixed_allocation)
}
brk = (LPVOID) ((Int) b + s);
#if DEBUG_WIN32_ALLOC
fprintf(stderr,"OK: %p--%p %lx\n",b, brk, s);
fprintf(stderr,"OK: %p--%p " Int_FORMAT "\n",b, brk, s);
#endif
Yap_PrologMode = OldPrologMode;
return TRUE;

View File

@ -1200,8 +1200,8 @@ Yap_InitThread(int new_id)
static void
InitFirstWorkerThreadHandle(void)
{
CACHE_REGS
#ifdef THREADS
CACHE_REGS
ThreadHandle.id = 0;
ThreadHandle.in_use = TRUE;
ThreadHandle.default_yaam_regs =
@ -1256,8 +1256,8 @@ static void
InitCodes(void)
{
CACHE_REGS
int wid;
#if THREADS
int wid;
for (wid = 1; wid < MAX_INITS; wid++) {
Yap_WLocal[wid] = NULL;
}
@ -1268,9 +1268,7 @@ InitCodes(void)
#endif
InitGlobal();
InitWorker(0);
#if THREADS
InitFirstWorkerThreadHandle();
#endif
/* make sure no one else can use these two atoms */
CurrentModule = 0;
Yap_ReleaseAtom(AtomOfTerm(TermReFoundVar));

5
H/TermExt.h Normal file → Executable file
View File

@ -515,7 +515,7 @@ IsAttachedTerm (Term t)
return (Int) ((IsVarTerm (t) && IsAttVar(VarOfTerm(t))));
}
inline EXTERN Int IsAttachedTerm (Term);
inline EXTERN Int GlobalIsAttachedTerm (Term);
inline EXTERN Int
GlobalIsAttachedTerm (Term t)
@ -523,9 +523,6 @@ GlobalIsAttachedTerm (Term t)
return (Int) ((IsVarTerm (t) && GlobalIsAttVar(VarOfTerm(t))));
}
inline EXTERN Int SafeIsAttachedTerm (Term);
inline EXTERN Int

View File

@ -269,7 +269,7 @@
#define FileAliases Yap_heap_regs->file_aliases
#define AtPrompt Yap_heap_regs->atprompt
#define Prompt Yap_heap_regs->prompt
#define YapPrompt Yap_heap_regs->_prompt
#define CharConversionTable Yap_heap_regs->char_conversion_table
#define CharConversionTable2 Yap_heap_regs->char_conversion_table2

View File

@ -269,7 +269,7 @@
struct AliasDescS *file_aliases;
Atom atprompt;
char prompt[MAX_PROMPT];
char _prompt[MAX_PROMPT];
char *char_conversion_table;
char *char_conversion_table2;

View File

@ -325,6 +325,7 @@ YAPDOCS=$(srcdir)/docs/yap.tex $(srcdir)/docs/chr.tex \
IOLIB_OBJECTS=pl-buffer.o pl-codelist.o pl-ctype.o pl-dtoa.o pl-error.o \
pl-file.o pl-files.o pl-fmt.o \
pl-glob.o pl-option.o \
pl-nt.o \
pl-os.o pl-privitf.o \
pl-read.o \
pl-rl.o \
@ -384,7 +385,6 @@ LIB_OBJECTS = $(ENGINE_OBJECTS) $(C_INTERFACE_OBJECTS) $(OR_OBJECTS) $(BEAM_OBJE
OBJECTS = yap.o $(LIB_OBJECTS)
PLCONS_OBJECTS = \
pl-nt.o \
pl-ntcon.o \
pl-ntconsole.o \
pl-ntmain.o
@ -552,8 +552,8 @@ regfree.o: $(srcdir)/library/regex/regfree.c $(srcdir)/library/regex/regex2.h co
regexec.o: $(srcdir)/library/regex/regexec.c config.h
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir)/library/regex $(srcdir)/library/regex/regexec.c -o regexec.o
pl-nt.o: $(srcdir)/console/LGPL/pl-nt.c config.h
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir)/packages/PLStream $(srcdir)/console/LGPL/pl-nt.c -o $@
pl-nt.o: $(srcdir)/packages/PLStream/pl-nt.c config.h
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-nt.c -o $@
pl-ntcon.o: $(srcdir)/console/LGPL/pl-ntcon.c config.h
$(CC) -c $(CFLAGS) -I$(srcdir)/include $(srcdir)/console/LGPL/pl-ntcon.c -o $@

View File

@ -176,6 +176,8 @@
#undef HAVE_ASINH
#undef HAVE_ATANH
#undef HAVE_CHDIR
#undef HAVE_CLOCK
#undef HAVE_CLOCK_GETTIME
#undef HAVE_CTIME
#undef HAVE_DLOPEN
#undef HAVE_DUP2
@ -291,6 +293,9 @@
#define TYPE_SELECT_
#define MYTYPE(X) MYTYPE1#X
#undef HAVE_VAR_TIMEZONE
#undef HAVE_STRUCT_TIME_TM_GMTOFF
/* define how to pass the address of a function */
#define FunAdr(Fn) Fn

230
configure vendored
View File

@ -813,9 +813,6 @@ LIBS
CPPFLAGS
CXX
CXXFLAGS
LDFLAGS
LIBS
CPPFLAGS
CCC
CPP'
@ -2136,60 +2133,6 @@ rm -f conftest.val
} # ac_fn_c_compute_int
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
# -------------------------------------------
# Tests whether TYPE exists after having included INCLUDES, setting cache
# variable VAR accordingly.
ac_fn_c_check_type ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=no"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
main ()
{
if (sizeof ($2))
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
main ()
{
if (sizeof (($2)))
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
eval "$3=yes"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_type
# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
# ----------------------------------------------------
# Tries to find if the field MEMBER exists in type AGGR, after including
@ -2246,6 +2189,60 @@ $as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_member
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
# -------------------------------------------
# Tests whether TYPE exists after having included INCLUDES, setting cache
# variable VAR accordingly.
ac_fn_c_check_type ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=no"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
main ()
{
if (sizeof ($2))
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
main ()
{
if (sizeof (($2)))
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
eval "$3=yes"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_type
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@ -2509,7 +2506,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;}
|| { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
fi
done
@ -2904,7 +2901,7 @@ fi
test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@ -3019,7 +3016,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
@ -3062,7 +3059,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@ -3121,7 +3118,7 @@ $as_echo "$ac_try_echo"; } >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
fi
fi
fi
@ -3173,7 +3170,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
@ -4235,7 +4232,7 @@ fi
$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
@ -4268,7 +4265,7 @@ fi
$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
@ -4301,7 +4298,7 @@ fi
$as_echo "$ac_cv_target" >&6; }
case $ac_cv_target in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;;
esac
target=$ac_cv_target
ac_save_IFS=$IFS; IFS='-'
@ -5060,6 +5057,7 @@ fi
if test "$target_os" = "cygwin" -o "$target_os" = "mingw32"
then
INSTALL_COMMAND=install_win32
EXTRA_INCLUDES_FOR_WIN32="-I\$(srcdir)/packages/PLStream/windows"
if test "$cygwin" = "no" -o "$target_os" = "mingw32"
then
if test "$target_win64" = yes
@ -5104,8 +5102,7 @@ _ACEOF
fi
EXTRA_LIBS_FOR_DLLS="-lws2_32 \$(abs_top_builddir)/yap.dll"
EXTRA_INCLUDES_FOR_WIN32="-I\$(srcdir)/packages/PLStream/windows"
EXTRA_LIBS_FOR_DLLS="-lws2_32"
elif test "$target_os" = "cygwin"
then
CC="${CC} -mno-cygwin"
@ -5149,8 +5146,6 @@ _ACEOF
fi
EXTRA_LIBS_FOR_DLLS="\$(abs_top_builddir)/yap.dll"
EXTRA_INCLUDES_FOR_WIN32="-I\$(srcdir)/packages/PLStream/windows"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lwsock32" >&5
$as_echo_n "checking for main in -lwsock32... " >&6; }
@ -5191,8 +5186,8 @@ _ACEOF
fi
EXTRA_LIBS_FOR_DLLS="\$(abs_top_builddir)/yap.dll"
fi
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS \$(abs_top_builddir)/yap.dll"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpsapi" >&5
$as_echo_n "checking for main in -lpsapi... " >&6; }
if ${ac_cv_lib_psapi_main+:} false; then :
@ -5671,7 +5666,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "--with-readline was given, but test for readline failed
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
fi
fi
@ -6042,7 +6037,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
fi
ac_ext=c
@ -6727,7 +6722,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
fi
ac_ext=c
@ -6791,7 +6786,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -8125,7 +8120,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (int *)
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
else
ac_cv_sizeof_int_p=0
fi
@ -8158,7 +8153,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (short int)
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
else
ac_cv_sizeof_short_int=0
fi
@ -8191,7 +8186,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (int)
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
else
ac_cv_sizeof_int=0
fi
@ -8224,7 +8219,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (long int)
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
else
ac_cv_sizeof_long_int=0
fi
@ -8257,7 +8252,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (long long int)
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
else
ac_cv_sizeof_long_long_int=0
fi
@ -8290,7 +8285,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (float)
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
else
ac_cv_sizeof_float=0
fi
@ -8323,7 +8318,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (double)
See \`config.log' for more details" "$LINENO" 5; }
See \`config.log' for more details" "$LINENO" 5 ; }
else
ac_cv_sizeof_double=0
fi
@ -8733,6 +8728,57 @@ $as_echo "#define HAVE_SIGINFO 0" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking \"variable timezone in tzset\"" >&5
$as_echo_n "checking \"variable timezone in tzset\"... " >&6; }
if test "$cross_compiling" = yes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming no" >&5
$as_echo "assuming no" >&6; }
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <time.h>
#include <stdlib.h>
#ifdef __CYGWIN__
#define timezone _timezone
#endif
extern long timezone;
main()
{ tzset();
if ( timezone > -15*3600 &&
timezone < 15*3600 &&
timezone % 60 == 0 )
return 0;
exit(1);
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
$as_echo "#define HAVE_VAR_TIMEZONE 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include <time.h>
"
if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes; then :
$as_echo "#define HAVE_STRUCT_TIME_TM_GMTOFF /**/" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking union wait" >&5
$as_echo_n "checking union wait... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@ -8840,7 +8886,19 @@ _ACEOF
fi
done
for ac_func in alloca asinh atanh chdir ctime dlopen dup2
for ac_func in alloca asinh atanh chdir clock clock_gettime
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
for ac_func in ctime dlopen dup2
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@ -10526,7 +10584,7 @@ do
"packages/swi-minisat2/Makefile") CONFIG_FILES="$CONFIG_FILES packages/swi-minisat2/Makefile" ;;
"packages/swi-minisat2/C/Makefile") CONFIG_FILES="$CONFIG_FILES packages/swi-minisat2/C/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
esac
done
@ -10843,7 +10901,7 @@ do
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
:L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
:L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
@ -10871,7 +10929,7 @@ do
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
esac
case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"

View File

@ -559,24 +559,22 @@ dnl
if test "$target_os" = "cygwin" -o "$target_os" = "mingw32"
then
INSTALL_COMMAND=install_win32
EXTRA_INCLUDES_FOR_WIN32="-I\$(srcdir)/packages/PLStream/windows"
if test "$cygwin" = "no" -o "$target_os" = "mingw32"
then
if test "$target_win64" = yes
then
AC_CHECK_LIB(ws2_32,main)
EXTRA_LIBS_FOR_DLLS="-lws2_32 \$(abs_top_builddir)/yap.dll"
EXTRA_INCLUDES_FOR_WIN32="-I\$(srcdir)/packages/PLStream/windows"
EXTRA_LIBS_FOR_DLLS="-lws2_32"
elif test "$target_os" = "cygwin"
then
CC="${CC} -mno-cygwin"
CXX="${CXX} -mno-cygwin"
AC_CHECK_LIB(wsock32,main)
EXTRA_LIBS_FOR_DLLS="\$(abs_top_builddir)/yap.dll"
EXTRA_INCLUDES_FOR_WIN32="-I\$(srcdir)/packages/PLStream/windows"
else
AC_CHECK_LIB(wsock32,main)
EXTRA_LIBS_FOR_DLLS="\$(abs_top_builddir)/yap.dll"
fi
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS \$(abs_top_builddir)/yap.dll"
AC_CHECK_LIB(psapi,main)
yap_cv_readline=no
if test "$target_win64" = yes
@ -1639,6 +1637,38 @@ else
AC_DEFINE(HAVE_SIGINFO,0)
fi
AC_MSG_CHECKING("variable timezone in tzset")
AC_TRY_RUN(
[ #include <time.h>
#include <stdlib.h>
#ifdef __CYGWIN__
#define timezone _timezone
#endif
extern long timezone;
main()
{ tzset();
if ( timezone > -15*3600 &&
timezone < 15*3600 &&
timezone % 60 == 0 )
return 0;
exit(1);
}
],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_VAR_TIMEZONE, 1,
[Define if tzset sets timezone variable]),
AC_MSG_RESULT(no),
AC_MSG_RESULT(assuming no))
AC_CHECK_MEMBER(struct tm.tm_gmtoff,
AC_DEFINE(HAVE_STRUCT_TIME_TM_GMTOFF, [],
[Define is struct tm has tm_gmtoff]),
[],
[#include <time.h>])
dnl this is copied from the Tcl code
dnl this code checks whether the system defines an union wait
AC_MSG_CHECKING([union wait])
@ -1667,7 +1697,8 @@ fi
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(_NSGetEnviron access acosh)
AC_CHECK_FUNCS(alloca asinh atanh chdir ctime dlopen dup2)
AC_CHECK_FUNCS(alloca asinh atanh chdir clock clock_gettime)
AC_CHECK_FUNCS(ctime dlopen dup2)
AC_CHECK_FUNCS(erf feclearexcept)
AC_CHECK_FUNCS(fesettrapenable fgetpos finite fpclass ftime getcwd getenv)
AC_CHECK_FUNCS(gethostbyname gethostent gethostid gethostname)

2
misc/HEAPFIELDS Normal file → Executable file
View File

@ -303,7 +303,7 @@ struct AliasDescS *file_aliases FileAliases =NULL RestoreAliases()
/* prompting */
Atom atprompt AtPrompt =AtomNil AtomAdjust
char prompt[MAX_PROMPT] Prompt void void
char _prompt[MAX_PROMPT] YapPrompt void void
/* ISO char conversion: I will make no comments */
char *char_conversion_table CharConversionTable =NULL CodeCharPAdjust

View File

@ -22,13 +22,13 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef _YAP_NOT_INSTALLED_
#ifdef __MINGW32__
#define __WINDOWS__ 1
#endif
#ifdef __WINDOWS__
#define _WIN32_WINNT 0x0400
#if (_MSC_VER >= 1300)
#if (_MSC_VER >= 1300) || defined(__MINGW32__)
#include <winsock2.h> /* Needed on VC8 */
#include <windows.h>
#else
@ -244,7 +244,6 @@ ftruncate(int fileno, int64_t length)
}
#ifndef _YAP_NOT_INSTALLED_
/*******************************
* QUERY CPU TIME *
*******************************/
@ -280,7 +279,6 @@ CpuTime(cputime_kind which)
return t;
}
#endif
static int
CpuCount()
@ -367,7 +365,7 @@ get_showCmd(term_t show, int *cmd)
succeed;
}
if ( !PL_get_chars_ex(show, &s, CVT_ATOM) )
if ( !PL_get_chars(show, &s, CVT_ATOM|CVT_EXCEPTION) )
fail;
for(st=types; st->name; st++)
{ if ( streq(st->name, s) )
@ -574,7 +572,7 @@ pl_win_module_file(term_t module, term_t file)
char *m;
char *f;
if ( !PL_get_chars_ex(module, &m, CVT_ALL) )
if ( !PL_get_chars(module, &m, CVT_ALL|CVT_EXCEPTION) )
fail;
if ( (f = findExecutable(m, buf)) )
return PL_unify_atom_chars(file, f);

View File

@ -62,6 +62,40 @@ extern long timezone;
#endif
#endif
#if defined(__MINGW32__)
#include <stdlib.h>
#include <time.h>
#include <string.h>
struct tm *localtime_r (const time_t *, struct tm *);
struct tm *gmtime_r (const time_t *, struct tm *);
struct tm *
localtime_r (const time_t *timer, struct tm *result)
{
struct tm *local_result;
local_result = localtime (timer);
if (local_result == NULL || result == NULL)
return NULL;
memcpy (result, local_result, sizeof (result));
return result;
}
struct tm *
gmtime_r (const time_t *timer, struct tm *result)
{
struct tm *local_result;
local_result = gmtime (timer);
if (local_result == NULL || result == NULL)
return NULL;
memcpy (result, local_result, sizeof (result));
return result;
}
#endif
#define TAI_UTC_OFFSET LL(4611686018427387914)