X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-posix%2Fmacros.lisp;h=aa69c474f0c1e31bc9a43fcfa781c135a2c0ab29;hb=260de2062fca170efdac3e42491d7d866c2d2e56;hp=95d25b7190d83c16f0e17c9160bcdc579226cd68;hpb=ffb003f5648f1abe64561c8a426878774e10a21b;p=sbcl.git diff --git a/contrib/sb-posix/macros.lisp b/contrib/sb-posix/macros.lisp index 95d25b7..aa69c47 100644 --- a/contrib/sb-posix/macros.lisp +++ b/contrib/sb-posix/macros.lisp @@ -140,3 +140,13 @@ a FILE-STREAM designating the underlying file-descriptor." (declaim (inline ,lisp-name)) (defun ,lisp-name ,arglist ,@body)))) + +(defmacro define-simple-call (name return-type &rest arguments) + (multiple-value-bind (lisp-name c-name) + (values name (substitute #\_ #\- (string-downcase name))) + `(progn + (export ',lisp-name :sb-posix) + (defun ,lisp-name ,(mapcar #'first arguments) + (alien-funcall (extern-alien ,c-name (function ,return-type + ,@(mapcar #'second arguments))) + ,@(mapcar #'first arguments)))))) \ No newline at end of file