diff options
author | Mike Gran <spk121@yahoo.com> | 2017-03-05 12:26:57 -0800 |
---|---|---|
committer | Mike Gran <spk121@yahoo.com> | 2017-03-05 12:45:54 -0800 |
commit | 4ce31fd387e89c8f64716866705a5a34651506ea (patch) | |
tree | 163d501bcd728bd1f97571cde285853b467960b6 /test-suite/standalone | |
parent | efd6e3f40c0cd2b9b5b8f947fc1ac2aeefcdf85f (diff) | |
download | guile-4ce31fd387e89c8f64716866705a5a34651506ea.tar.gz |
Can't recursively search DLLs with FFI on Cygwin
* doc/ref/api-foreign.text (dynamic-link): document problems with recursive DLLs.
* test-suite/standalone/test-ffi (global): with Cygwin, dynamic-link C library explicitly
* test-suite/standalone/test-foreign-object-scm (libc-ptr): with Cygwin, link C library explicitly
* test-suite/tests/foreign.test (qsort): with Cygwin, link C library explicitly
Diffstat (limited to 'test-suite/standalone')
-rwxr-xr-x | test-suite/standalone/test-ffi | 12 | ||||
-rwxr-xr-x | test-suite/standalone/test-foreign-object-scm | 14 |
2 files changed, 22 insertions, 4 deletions
diff --git a/test-suite/standalone/test-ffi b/test-suite/standalone/test-ffi index 0a91f63f9..0e6ab45d1 100755 --- a/test-suite/standalone/test-ffi +++ b/test-suite/standalone/test-ffi @@ -3,7 +3,7 @@ exec guile -q -s "$0" "$@" !# ;;; test-ffi --- Foreign function interface. -*- Scheme -*- ;;; -;;; Copyright (C) 2010 Free Software Foundation, Inc. +;;; Copyright (C) 2010, 2017 Free Software Foundation, Inc. ;;; ;;; This library is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU Lesser General Public @@ -263,7 +263,15 @@ exec guile -q -s "$0" "$@" (if (defined? 'setlocale) (setlocale LC_ALL "C")) -(define global (dynamic-link)) +(define global (cond + ((string-contains %host-type "cygwin") + ;; On Cygwin, dynamic-link doesn't search recursively + ;; into linked DLLs. Thus one needs to link to the core + ;; C library DLL explicitly. + (dynamic-link "cygwin1")) + (else + (dynamic-link)))) + (define strerror (pointer->procedure '* (dynamic-func "strerror" global) diff --git a/test-suite/standalone/test-foreign-object-scm b/test-suite/standalone/test-foreign-object-scm index 7e4bd85d8..fd4669aa9 100755 --- a/test-suite/standalone/test-foreign-object-scm +++ b/test-suite/standalone/test-foreign-object-scm @@ -3,7 +3,7 @@ exec guile -q -s "$0" "$@" !# ;;; test-foreign-object-scm --- Foreign object interface. -*- Scheme -*- ;;; -;;; Copyright (C) 2014 Free Software Foundation, Inc. +;;; Copyright (C) 2014, 2017 Free Software Foundation, Inc. ;;; ;;; This library is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU Lesser General Public @@ -26,7 +26,17 @@ exec guile -q -s "$0" "$@" (define (libc-ptr name) (catch #t - (lambda () (dynamic-pointer name (dynamic-link))) + (lambda () + (dynamic-pointer name + (cond + ((string-contains %host-type "cygwin") + ;; On Cygwin, dynamic-link does not search + ;; recursively into linked DLLs. Thus, one + ;; needs to link to the core C library DLL + ;; explicitly. + (dynamic-link "cygwin1")) + (else + (dynamic-link))))) (lambda (k . args) (print-exception (current-error-port) #f k args) (write "Skipping test.\n" (current-error-port)) |