diff -r cb65bfaf7110 nt/xemacs.mak
--- a/nt/xemacs.mak	Fri Mar 27 16:05:15 2015 +0100
+++ b/nt/xemacs.mak	Tue Jul 28 12:28:05 2015 +0100
@@ -543,6 +543,7 @@
 OPT_DEFINES=$(OPT_DEFINES) -DHAVE_XPM -DFOR_MSW
 OPT_INCLUDES=$(OPT_INCLUDES) -I"$(XPM_DIR)" -I"$(XPM_DIR)\lib"
 OPT_LIBS=$(OPT_LIBS) "$(XPM_DIR)\lib\Xpm.lib"
+OPT_PATH=$(OPT_PATH)$(XPM_DIR)\lib;
 !endif
 !if $(HAVE_GIF)
 OPT_DEFINES=$(OPT_DEFINES) -DHAVE_GIF
@@ -595,8 +596,10 @@
 OPT_INCLUDES=$(OPT_INCLUDES) -I"$(DATABASE_DIR)\build_win32"
 !if $(BUILD_DATABASE_SHARED)
 OPT_LIBS=$(OPT_LIBS) "$(DATABASE_DIR)\build_win32\Release\libdb43.lib"
+OPT_PATH=$(OPT_PATH)$(DATABASE_DIR)\build_win32\Release;
 !else
 OPT_LIBS=$(OPT_LIBS) "$(DATABASE_DIR)\build_win32\Release_static\libdb43s.lib"
+OPT_PATH=$(OPT_PATH)$(DATABASE_DIR)\build_win32\Release_static;
 !endif
 OPT_OBJS=$(OPT_OBJS) $(OUTDIR)\database.obj
 !endif
@@ -738,10 +741,10 @@
 !if $(USE_CRTDLL)
 !  if $(DEBUG_XEMACS) && "$(OK_TO_USE_MSVCRTD)" == "1"
 C_LIBFLAG=-MDd
-LIBC_LIB=msvcrtd.lib
+LIBC_LIB=msvcrtd.lib ucrtd.lib vcruntimed.lib
 !  else
 C_LIBFLAG=-MD
-LIBC_LIB=msvcrt.lib
+LIBC_LIB=msvcrt.lib ucrt.lib vcruntime.lib
 !  endif
 !else
 C_LIBFLAG=-ML
@@ -793,7 +796,7 @@
 INCLUDES=-I$(NT)\inc -I$(SRC) $(OPT_INCLUDES)
 
 DEFINES=$(OPT_DEFINES) \
-	-DWIN32_LEAN_AND_MEAN -DWIN32_NATIVE -Demacs \
+	-DWIN32_LEAN_AND_MEAN -DWIN32_NATIVE -Demacs  -DNTDDI_VERSION=NTDDI_WIN2K -D_WIN32_WINNT=_WIN32_WINNT_WIN2K -D_CRT_NO_POSIX_ERROR_CODES \
 	-DHAVE_CONFIG_H $(PROGRAM_DEFINES) $(PATH_DEFINES)
 
 CFLAGS_NO_OPT=-nologo -W3 -DSTRICT $(DEBUG_FLAGS_COMPILE)
@@ -1103,7 +1106,7 @@
 # If we're using Visual Studio 2005 or greater,
 # embed the manifest into the executable.
 !if $(MSC_VER) >= 1400
-	mt -manifest $@.manifest -outputresource:$@;1
+	@if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
 !endif
 
 # Individual dependencies
@@ -1113,7 +1116,7 @@
 # If we're using Visual Studio 2005 or greater,
 # embed the manifest into the executable.
 !if $(MSC_VER) >= 1400
-	mt -manifest $@.manifest -outputresource:$@;1
+	@if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
 !endif
 
 $(BLDLIB_SRC)/movemail.exe : $(LIB_SRC)/movemail.c $(LIB_SRC)/pop.c $(ETAGS_DEPS)
@@ -1124,7 +1127,7 @@
 # If we're using Visual Studio 2005 or greater,
 # embed the manifest into the executable.
 !if $(MSC_VER) >= 1400
-	mt -manifest $@.manifest -outputresource:$@;1
+	@if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
 !endif
 
 LIB_SRC_TOOLS = \
@@ -1334,8 +1337,10 @@
 
 RAW_EXE=$(BLDSRC)\temacs.exe
 DUMP_TARGET = $(BLDSRC)\xemacs.exe
-DO_TEMACS = "$(BLDLIB_SRC)\i" "$(RAW_EXE)"
-DO_XEMACS = "$(BLDLIB_SRC)\i" "$(DUMP_TARGET)"
+#DO_TEMACS = "$(BLDLIB_SRC)\i" "$(RAW_EXE)" removed by HST, i.exe crashes
+DO_TEMACS = "$(RAW_EXE)"
+#DO_XEMACS = "$(BLDLIB_SRC)\i" "$(DUMP_TARGET)" ditto
+DO_XEMACS = "$(DUMP_TARGET)"
 
 BATCH = -no-packages -batch
 BATCH_PACKAGES = -vanilla -batch
@@ -1397,6 +1402,7 @@
 ## (3) Update the .elc's needed for dumping
 
 update-elc: $(RAW_EXE)
+	set PATH=$(OPT_PATH)$(PATH)
 	$(TEMACS_BATCH) -l $(LISP)\update-elc.el
 
 ## This file is touched by update-elc.el when redumping is necessary.
@@ -1417,11 +1423,15 @@
 # calculates dependencies; see comments in src/Makefile.in.in.
 $(DOC): $(BLDLIB_SRC)\make-docfile.exe $(BLDSRC)\NEEDTODUMP $(TEMACS_DOC_SOURCES)
 !if $(QUICK_BUILD)
-	if not exist $(DOC) $(TEMACS_BATCH) -l $(LISP)\make-docfile.el -- -o $(DOC) -i $(SRCROOT)\site-packages @<<
+	if not exist $(DOC) (
+	set PATH=$(OPT_PATH)$(PATH)
+	$(TEMACS_BATCH) -l $(LISP)\make-docfile.el -- -o $(DOC) -i $(SRCROOT)\site-packages @<<
 $(**)
 <<
 	-touch $(DOC)
+	)
 !else
+	set PATH=$(OPT_PATH)$(PATH)
 	$(TEMACS_BATCH) -l $(LISP)\make-docfile.el -- -o $(DOC) -i $(SRCROOT)\site-packages @<<
 $(**)
 <<
@@ -1437,6 +1447,7 @@
 # requirements have changed.
 
 $(DUMP_TARGET): $(DOC) $(RAW_EXE) $(BLDSRC)\NEEDTODUMP
+	set PATH=$(OPT_PATH)$(PATH)
 	$(TEMACS_BATCH) -l $(LISP)\loadup.el dump
 !if $(USE_PORTABLE_DUMPER)
 	cd $(BLDSRC)
@@ -1450,7 +1461,7 @@
 # If we're using Visual Studio 2005 or greater,
 # embed the manifest into the executable.
 !if $(MSC_VER) >= 1400
-	mt -manifest $@.manifest -outputresource:$@;1
+	@if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
 !endif
 
 !endif
@@ -1458,6 +1469,7 @@
 ## (6) Update the remaining .elc's, post-dumping
 
 update-elc-2: $(DUMP_TARGET)
+	set PATH=$(OPT_PATH)$(PATH)
 	$(XEMACS_BATCH) -no-autoloads -l update-elc-2.el -f batch-update-elc-2 $(LISP)
 
 ## (7) Other random stuff
@@ -1465,6 +1477,7 @@
 $(LISP)/finder-inf.el: update-elc-2
 !if !$(QUICK_BUILD)
 	@echo Building finder database ...
+	set PATH=$(OPT_PATH)$(PATH)
 	$(XEMACS_BATCH)	-eval "(setq finder-compile-keywords-quiet t)" \
 		-l finder -f finder-compile-keywords
 	@echo Building finder database ...(done)
@@ -1473,6 +1486,7 @@
 load-shadows: update-elc-2
 !if !$(QUICK_BUILD)
 	@echo Testing for Lisp shadows ...
+	set PATH=$(OPT_PATH)$(PATH)
 	@$(XEMACS_BATCH) -f list-load-path-shadows
 !endif
 
@@ -1501,6 +1515,7 @@
 
 {$(MANDIR)}.texi{$(INFODIR)}.info:
 	cd $(MANDIR)
+	set PATH=$(OPT_PATH)$(PATH)
 	$(MAKEINFO) $(**F)
 
 XEMACS_SRCS = \
@@ -1633,18 +1648,22 @@
 
 $(INFODIR)\xemacs.info: $(XEMACS_SRCS)
 	cd $(MANDIR)\xemacs
+	set PATH=$(OPT_PATH)$(PATH)
 	$(MAKEINFO) xemacs.texi
 
 $(INFODIR)\lispref.info: $(LISPREF_SRCS)
 	cd $(MANDIR)\lispref
+	set PATH=$(OPT_PATH)$(PATH)
 	$(MAKEINFO) lispref.texi
 
 $(INFODIR)\internals.info: $(INTERNALS_SRCS)
 	cd $(MANDIR)\internals
+	set PATH=$(OPT_PATH)$(PATH)
 	$(MAKEINFO) internals.texi
 
 $(INFODIR)\new-users-guide.info: $(NEW_USERS_GUIDE_SRCS)
 	cd $(MANDIR)\new-users-guide
+	set PATH=$(OPT_PATH)$(PATH)
 	$(MAKEINFO) new-users-guide.texi
 
 info:	makeinfo-test $(INFO_FILES)
@@ -1660,14 +1679,17 @@
 
 check:
 	cd $(BLDSRC)
+	set PATH=$(OPT_PATH)$(PATH)
 	$(DO_XEMACS) $(batch_test_emacs)
 
 check-temacs:
 	cd $(BLDSRC)
+	set PATH=$(OPT_PATH)$(PATH)
 	$(TEMACS_BATCH) $(run_temacs_args) $(batch_test_emacs)
 
 check-features: all
 	cd $(BLDSRC)
+	set PATH=$(OPT_PATH)$(PATH)
 	$(XEMACS_BATCH) -l check-features.el
 
 
@@ -1832,6 +1854,7 @@
 @echo off
 @"$(MAKEINFO)" --version
 @if not errorlevel 1 goto test_done
+@set PATH=$(OPT_PATH)$(PATH)
 @$(XEMACS_BATCH_PACKAGES) -eval "(condition-case nil (require (quote texinfo)) (t (kill-emacs 1)))"
 @if not errorlevel 1 goto suggest_makeinfo
 @echo XEmacs 'info' cannot be built!
diff -r cb65bfaf7110 src/intl-auto-encap-win32.c
--- a/src/intl-auto-encap-win32.c	Fri Mar 27 16:05:15 2015 +0100
+++ b/src/intl-auto-encap-win32.c	Tue Jul 28 12:28:05 2015 +0100
@@ -36,13 +36,14 @@
     return PeekConsoleInputA (arg1, arg2, arg3, arg4);
 }
 
+/* HST did this */
 BOOL
-qxeReadConsole (HANDLE arg1, PVOID arg2, DWORD arg3, PDWORD arg4, PVOID arg5)
-{
-  if (XEUNICODE_P)
-    return ReadConsoleW (arg1, arg2, arg3, arg4, arg5);
-  else
-    return ReadConsoleA (arg1, arg2, arg3, arg4, arg5);
+qxeReadConsole (HANDLE hConsoleInput, LPVOID lpBuffer, DWORD nNumberOfCharsToRead, LPDWORD lpNumberOfCharsRead, LPVOID lpReserved)
+{
+  if (XEUNICODE_P)
+    return ReadConsoleW (hConsoleInput, lpBuffer, nNumberOfCharsToRead, lpNumberOfCharsRead, (PCONSOLE_READCONSOLE_CONTROL)lpReserved);
+  else
+    return ReadConsoleA (hConsoleInput, lpBuffer, nNumberOfCharsToRead, lpNumberOfCharsRead, (PCONSOLE_READCONSOLE_CONTROL)lpReserved);
 }
 
 BOOL
@@ -3346,6 +3347,7 @@
     return (Extbyte *) GetCommandLineA ();
 }
 
+/*HST did this
 DWORD
 qxeGetCompressedFileSize (const Extbyte * arg1, PDWORD arg2)
 {
@@ -3354,6 +3356,7 @@
   else
     return GetCompressedFileSizeA ((LPCSTR) arg1, arg2);
 }
+*/
 
 BOOL
 qxeGetComputerName (Extbyte * arg1, PDWORD arg2)
diff -r cb65bfaf7110 src/s/windowsnt.h
--- a/src/s/windowsnt.h	Fri Mar 27 16:05:15 2015 +0100
+++ b/src/s/windowsnt.h	Tue Jul 28 12:28:05 2015 +0100
@@ -63,6 +63,8 @@
 
 #define HAVE_TIMEVAL
 #define HAVE_TZNAME
+/* need this, where should it go? HST */
+#define tzname _tzname
 #define HAVE_H_ERRNO
 
 #define HAVE_CLOSEDIR
@@ -176,9 +178,11 @@
 #pragma warning ( disable : 4646 )
 #endif 
 
-/* MSVC version >= 2.x without /Za supports __inline */
+/* MSVC version >= 2.x without /Za supports __inline
+   HST cut this -- VS2015 complains
 #if (_MSC_VER < 900) || defined (__STDC__)
 # define inline
 #else
 # define inline __inline
 #endif
+ */
diff -r cb65bfaf7110 src/sysproc.h
--- a/src/sysproc.h	Fri Mar 27 16:05:15 2015 +0100
+++ b/src/sysproc.h	Tue Jul 28 12:28:05 2015 +0100
@@ -35,8 +35,8 @@
    This is not true with visual c though. The trick below works with
    VC4.2b, 5.0 and 6.0. It assumes that VC is installed in a kind of
    standard way, so include path ends with /include.
-*/
-#include <../include/process.h>
+   HST changed this to ucrt */
+#include <../ucrt/process.h>
 #endif
 
 #ifdef HAVE_SOCKETS	/* TCP connection support, if kernel can do it */
