fix: use non-deprecated unlink function on windows (#1311)

This commit is contained in:
Veit Heller 2021-09-16 07:56:32 +02:00 committed by GitHub
parent a4f8041288
commit 5a449b0919
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,10 @@ module are wrappers around the C standard library.")
(register rewind (Fn [(Ptr FILE)] ()) "rewind")
(private unlink-)
(hidden unlink-)
(register unlink- (Fn [(Ptr CChar)] Int) "unlink")
(register unlink- (Fn [(Ptr CChar)] Int) "unlink")
(windows-only
; override unlink for windows
(register unlink- (Fn [(Ptr CChar)] Int) "_unlink"))
(doc unlink "unlinks a file, i.e. deletes it (thin wrapper for POSIX api in <unistd.h>).")
(defn unlink [file-name]
(unlink- (String.cstr file-name)) )