cmpc: get rid of an undocumented and unused code path for FFI:CLINES

We've supported syntax for clines that allowed inlining Lisp objects when they
were prepended with @, for example (ffi:clines "#include @my-variable"); that
said I have not seen a single use of this syntax and it compilcated the logic
(the read object needed to land in the data segment during the second pass).
This commit is contained in:
Daniel Kochmański 2023-06-30 12:46:03 +02:00
parent 5a8f6780b8
commit f195f7d574

View file

@ -33,25 +33,13 @@
'(progn))
(defun output-clines (output-stream)
(flet ((parse-one-string (s output-stream)
(with-input-from-string (stream s)
(loop for c = (read-char stream nil nil)
while c
do (if (eq c #\@)
(let ((object (handler-case (read stream)
(serious-condition (c)
(cmperr "Unable to parse FFI:CLINES string~& ~S"
s)))))
(let ((*compiler-output1* output-stream))
(wt (add-object object :permanent t))))
(write-char c output-stream))))))
(loop for s in *clines-string-list*
do (terpri output-stream)
do (if (find #\@ s)
(parse-one-string s output-stream)
(write-string s output-stream)))
(terpri output-stream)
(setf *clines-string-list* nil)))
(loop for s in *clines-string-list*
do (terpri output-stream)
do (if (find #\@ s)
(cmperr "The character #\\@ is not allowed in ~s." 'FFI:CLINES)
(write-string s output-stream)))
(terpri output-stream)
(setf *clines-string-list* nil))
;; ----------------------------------------------------------------------
;; C/C++ INLINE CODE