X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=examples%2Fcompress.lisp;fp=examples%2Fcompress.lisp;h=e5140aea57b6d4b60988d5dd2cb670b7175142cc;hb=603822b8bfea96aa4ee6bccec88fb372d84dcc30;hp=75d79c4d02ed95ee3c73341f2671db9254bd1743;hpb=77378d36f07fe1f11893444217716b01628a329f;p=uffi.git diff --git a/examples/compress.lisp b/examples/compress.lisp index 75d79c4..e5140ae 100644 --- a/examples/compress.lisp +++ b/examples/compress.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: compress.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $ +;;;; $Id: compress.lisp,v 1.2 2002/12/03 06:58:39 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -18,15 +18,20 @@ (in-package :cl-user) -(unless (uffi:load-foreign-library - (uffi:find-foreign-library - "libz" - '("/usr/local/lib/" "/usr/lib/" "/zlib/") - :types '("so" "a" "dylib")) - :module "zlib" - :supporting-libraries '("c")) - (warn "Unable to load zlib")) - +(eval-when (:load-toplevel :execute) + (unless (uffi:load-foreign-library + #-(or macosx darwin) + (uffi:find-foreign-library + "libz" + '("/usr/local/lib/" "/usr/lib/" "/zlib/") + :types '("so" "a")) + #+(or macosx darwin) + (uffi:find-foreign-library "z" + `(,(pathname-directory *load-pathname*))) + :module "zlib" + :supporting-libraries '("c")) + (warn "Unable to load zlib"))) + (uffi:def-function ("compress" c-compress) ((dest (* :unsigned-char)) (destlen (* :long))