upgrade asdf to 2.29, per request by Faré (sbcl-devel 2013-02-16)
[sbcl.git] / contrib / sb-posix / macros.lisp
index e9ec78b..aa69c47 100644 (file)
@@ -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