Call a foreign-language function: Difference between revisions

m
Line 1,818:
(define self (load-dynamic-library #f))
(define strdup (self type-string "strdup" type-string))
 
(print (strdup "Hello World!"))
</lang>
 
Windows has no a "strdup" function, so windows version should look like this.
<lang scheme>
(import (otus ffi))
 
(if (not (has? *features* 'Windows))
(print "The host platform is not a Windows!"))
 
(define self (load-dynamic-library "shlwapi.dll"))
(define strdup (self type-string "StrDupA" type-string))
 
(print (strdup "Hello World!"))