Changeset 11493


Ignore:
Timestamp:
Dec 9, 2008, 2:37:54 AM (11 years ago)
Author:
gb
Message:

Ignore forms in the .ffi file that don't start with a #\( on the first
character of a line. (Inline assembler and some other things may
output assembler directives.)

Don't even try to expand macros that contain apparent C function calls.
(Not sure if this fixes a problem or a symptom, but some of the stdio
macros on FreeBSD expand into this kind of thing, and now that we
handle conditional expressions more correctly we can stack overflow
wandering around in the expansions.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/library/parse-ffi.lisp

    r11486 r11493  
    721721
    722722
     723(defun read-ffi-toplevel-form (stream eof-value)
     724  (loop
     725    (let* ((ch (peek-char  nil stream nil eof-value)))
     726      (cond ((eq ch eof-value) (return eof-value))
     727            ((eql ch #\() (return (read stream nil eof-value)))
     728            (t (read-line stream))))))
    723729
    724730(defun parse-ffi (inpath)
     
    737743        (let* ((*ffi-ordinal* -1))
    738744          (let* ((*package* (find-package "KEYWORD")))
    739             (do* ((form (read in nil :eof) (read in nil :eof)))
     745            (do* ((form (read-ffi-toplevel-form in :eof)
     746                        (read-ffi-toplevel-form in :eof)))
    740747                 ((eq form :eof))
    741748              (case (car form)
     
    12931300                                         `(c::cast ,(evaluate-type-name (list left))
    12941301                                           ,@(parse-argument-list)))
    1295                                         (t `(c::call ,left ,@(parse-argument-list))))))
     1302                                        (t nil #|`(c::call ,left ,@(parse-argument-list))|#))))
    12961303                               ((memq right '(c::|.| c::|->|))
    12971304                                (next)          ; swallow operator
Note: See TracChangeset for help on using the changeset viewer.