(define impc:aot:insert-load-dylib-details
(lambda (library lib-path . args)
(if (and (output-port? *impc:aot:current-output-port*)
#t) ;*impc:compiler:aot:dll*)
(begin
(write
(list 'bind-dylib library `(list ,@lib-path))
*impc:aot:current-output-port*)
(write
`(if (not ',library)
(begin
(print-with-colors '*impc:compiler:pretty-print-error-color* 'default #t (print "Error"))
(print ": could not load the " ',library
" dynamic library - perhaps you can install it through your package manager?\n")
(error "")))
*impc:aot:current-output-port*)
(newline *impc:aot:current-output-port*)
(if (and (not (null? args)) (string? (car args)))
(begin
(write (list 'bind-external-dylib-declarations (symbol->string library) (car args))
*impc:aot:current-output-port*)
(newline *impc:aot:current-output-port*)))
))))