X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Ffunctions.lisp;h=7f0939d5afe2dd20fdcf7d7264096483a39e51fb;hb=5ee29e2a72598eb6db2063510b2ea6046945b70c;hp=f23ec8f6163de4f38f06083c5233ca952105a90b;hpb=caf4972e7f7d2562fe4a9977cf20d38bbf0e320f;p=uffi.git diff --git a/src/functions.lisp b/src/functions.lisp index f23ec8f..7f0939d 100644 --- a/src/functions.lisp +++ b/src/functions.lisp @@ -2,12 +2,12 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; Name: function.cl +;;;; Name: function.lisp ;;;; Purpose: UFFI source to C function definitions ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: functions.lisp,v 1.5 2002/10/16 11:56:43 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -16,14 +16,13 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0))) -(in-package :uffi) +(in-package #:uffi) (defun process-function-args (args) (if (null args) #+(or lispworks cmu sbcl scl cormanlisp (and mcl (not openmcl))) nil #+allegro '(:void) - #+mcl (values nil nil) + #+openmcl (values nil nil) ;; args not null #+(or lispworks allegro cmu sbcl scl (and mcl (not openmcl)) cormanlisp) @@ -33,16 +32,15 @@ (nreverse processed)) #+openmcl (let ((processed nil) - (params nil) - name type) + (params nil)) (dolist (arg args) - (setf name (car arg)) - (setf type (convert-from-uffi-type (cadr arg) :routine)) - ;;(when (and (listp type) (eq (car type) :address)) - ;;(setf type :address)) - (push name params) - (push type processed) - (push name processed)) + (let ((name (car arg)) + (type (convert-from-uffi-type (cadr arg) :routine))) + ;;(when (and (listp type) (eq (car type) :address)) + ;;(setf type :address)) + (push name params) + (push type processed) + (push name processed))) (values (nreverse params) (nreverse processed))) )) @@ -55,6 +53,8 @@ (if (and (listp type) (listp (car type))) (append (list name) type) (list name type)) + #+openmcl + (declare (ignore name type)) )) @@ -93,12 +93,15 @@ ,function-args ,@(if module (list :module module) (values)) :result-type ,result-type + :language :ansi-c :calling-convention :cdecl) #+(and mcl (not openmcl)) `(eval-when (:compile-toplevel :load-toplevel :execute) (ccl:define-entry-point (,lisp-name ,foreign-name) ,function-args ,result-type)) + #+openmcl + (declare (ignore function-args)) #+(and openmcl darwinppc-target) (setf foreign-name (concatenate 'string "_" foreign-name)) #+openmcl