mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-18 07:12:26 -08:00
DEFENTRY can now wrap forms in no interrupt blocks
This commit is contained in:
parent
6bd1b30f5e
commit
e578cc9aa8
1 changed files with 12 additions and 6 deletions
|
|
@ -733,7 +733,7 @@ defined Lisp function and VALUE-TYPE is its the return type."
|
|||
(c-inline ,args ,arg-types ,result-type
|
||||
,C-expr :one-liner t))))
|
||||
|
||||
(defmacro defentry (name arg-types c-name)
|
||||
(defmacro defentry (name arg-types c-name &key no-interrupts)
|
||||
"Syntax: (defentry symbol ({arg-type}*) (value-type function-name))
|
||||
|
||||
The compiler defines a Lisp function named by SYMBOL whose body consists of a
|
||||
|
|
@ -746,9 +746,15 @@ CHAR, CHAR*, FLOAT, DOUBLE are allowed for these types."
|
|||
(if (consp c-name)
|
||||
(setf output-type (first c-name)
|
||||
c-name (second c-name)))
|
||||
(setf c-name (string c-name))
|
||||
`(defun ,name ,args
|
||||
(c-inline ,args ,arg-types ,output-type
|
||||
,(produce-function-call c-name (length arg-types))
|
||||
:one-liner t))))
|
||||
(let* ((call (produce-function-call (string c-name) (length arg-types)))
|
||||
(full-text (if no-interrupts
|
||||
(concatenate 'string
|
||||
"ecl_disable_interrupts();@(return)="
|
||||
call
|
||||
";ecl_enable_interrupts();")
|
||||
call)))
|
||||
`(defun ,name ,args
|
||||
(c-inline ,args ,arg-types ,output-type
|
||||
,full-text
|
||||
:one-liner ,(not no-interrupts))))))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue