pprint-c-function-type function
ptr c-type
ptrdiff-t c-type
+ reify-variable-argument-tail function
cl:schar function setf c-type
short c-type
short-int c-type
@|commentify-argument-names| to the argument list of the given type.
\end{describe}
+\begin{describe}{fun}{reify-variable-argument-tail @<arguments> @> @<list>}
+ If the @<argument> list contains an @|:ellipsis| marker, then replace it
+ with a @|va_list|. The name for the new argument, if any, is taken from
+ the \descref{*sod-ap*}[variable]{var}. The new list is returned; the
+ original list is not modified, but may share structure with the new list.
+\end{describe}
+
\begin{describe}{fun}
{pprint-c-function-type @<return-type> @<stream>
@<print-args> @<print-kernel>}
(commentify-argument-names
(c-function-arguments type))))
+(export 'reify-variable-argument-tail)
+(defun reify-variable-argument-tail (arguments)
+ "Replace any `:ellipsis' item in ARGUMENTS with a `va_list' argument.
+
+ The argument's name is taken from the variable `*sod-ap*'."
+ (substitute (make-argument *sod-ap* c-type-va-list) :ellipsis arguments))
+
;;;----- That's all, folks --------------------------------------------------
(c-function-arguments (sod-message-type message)))))
(define-on-demand-slot basic-message no-varargs-tail (message)
- (mapcar (lambda (arg)
- (if (eq arg :ellipsis)
- (make-argument *sod-ap* c-type-va-list)
- arg))
- (sod-message-argument-tail message)))
+ (reify-variable-argument-tail (sod-message-argument-tail message)))
(defmethod sod-message-method-class
((message basic-message) (class sod-class) pset)
;; C type representation protocol.
(:file "c-types-proto" :depends-on ("package"))
- (:file "c-types-impl" :depends-on ("c-types-proto"))
+ (:file "c-types-impl" :depends-on ("c-types-proto" "codegen-proto"))
(:file "c-types-parse" :depends-on
("c-types-proto" "c-types-class-impl" "fragment-parse"))