X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-posix%2Fmacros.lisp;h=aa69c474f0c1e31bc9a43fcfa781c135a2c0ab29;hb=8369a441bfd49566e70939c25f42f8d1f5423e4e;hp=e9ec78b478fd36aba5338c7148a30da7a3e4cac6;hpb=139f0ec74424e0ab3e6c5bc7268652d96fb7ff1a;p=sbcl.git diff --git a/contrib/sb-posix/macros.lisp b/contrib/sb-posix/macros.lisp index e9ec78b..aa69c47 100644 --- a/contrib/sb-posix/macros.lisp +++ b/contrib/sb-posix/macros.lisp @@ -119,7 +119,7 @@ a FILE-STREAM designating the underlying file-descriptor." ,(car x)) (car x))) arguments)))) - (if (,error-predicate r) (syscall-error) r)))) + (if (,error-predicate r) (syscall-error ',lisp-name) r)))) `(sb-int:style-warn "Didn't find definition for ~S" ,c-name))) (defmacro define-call (name return-type error-predicate &rest arguments) @@ -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