Don't load msvcrt.dll when built with UCRT.

This commit is contained in:
Stas Boukarev 2025-04-04 02:09:38 +03:00
parent 0be0e832cd
commit 48ab9725ca
6 changed files with 18 additions and 7 deletions

View file

@ -1,2 +1,2 @@
(sb-alien:load-shared-object "ws2_32.dll") (sb-alien:load-shared-object "ws2_32.dll")
(sb-alien:load-shared-object "msvcrt.dll")

View file

@ -29,6 +29,3 @@
)) ))
(eval-when (:compile-toplevel :load-toplevel :execute) (eval-when (:compile-toplevel :load-toplevel :execute)
(setf (sb-int:system-package-p (find-package "SB-POSIX")) t)) (setf (sb-int:system-package-p (find-package "SB-POSIX")) t))
#+win32
(sb-alien:load-shared-object "msvcrt.dll")

View file

@ -744,8 +744,11 @@ not supported."
(defmacro define-stat-call (name arg designator-fun type) (defmacro define-stat-call (name arg designator-fun type)
;; FIXME: this isn't the documented way of doing this, surely? ;; FIXME: this isn't the documented way of doing this, surely?
(let ((lisp-name (lisp-for-c-symbol name)) (let ((lisp-name (lisp-for-c-symbol name))
(real-name #+inode64 (format nil "~A$INODE64" name) (real-name (or #+inode64
#-inode64 name)) (format nil "~A$INODE64" name)
#+(and ucrt 64-bit)
(format nil "~A64" name)
name)))
`(progn `(progn
(export ',lisp-name :sb-posix) (export ',lisp-name :sb-posix)
(declaim (inline ,lisp-name)) (declaim (inline ,lisp-name))

View file

@ -6,7 +6,7 @@
#+win32 #+win32
(progn (progn
(load-shared-object "kernel32.dll") (load-shared-object "kernel32.dll")
(load-shared-object "msvcrt.dll") (load-shared-object #+ucrt "ucrtbase.dll" #-ucrt "msvcrt.dll")
(load-shared-object "advapi32.dll") (load-shared-object "advapi32.dll")
(load-shared-object "ws2_32.dll") (load-shared-object "ws2_32.dll")
(load-shared-object "shell32.dll")) (load-shared-object "shell32.dll"))

View file

@ -34,6 +34,7 @@ featurep() {
# It will get added in by Config.*-win32 only if LISP_FEATURE_SB_FUTEX. # It will get added in by Config.*-win32 only if LISP_FEATURE_SB_FUTEX.
if [ "$sbcl_os" = win32 ] ; then if [ "$sbcl_os" = win32 ] ; then
LOADLIBES=-lSynchronization featurep os-provides-wakebyaddr sb-futex LOADLIBES=-lSynchronization featurep os-provides-wakebyaddr sb-futex
featurep ucrt
fi fi
featurep os-provides-dlopen featurep os-provides-dlopen

View file

@ -0,0 +1,10 @@
#include <windows.h>
int main ()
{
#ifdef _UCRT
return 104;
#else
return 1;
#endif
}