src/class-output.lisp: Make `__CONV_' macros more robust.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 9 Sep 2015 09:35:47 +0000 (10:35 +0100)
If the formal argument name is a simple identifier, then things come
unstuck when there's a chain head with that same nickname.  So make the
argument name be something which isn't allowed as a class nickname.

src/class-output.lisp

index eb5bc26..d914864 100644 (file)
@@ -98,8 +98,8 @@
         (format stream "/* Conversion macros. */~%")
         (dolist (super (cdr (sod-class-precedence-list class)))
           (let ((super-head (sod-class-chain-head super)))
-            (format stream "#define ~:@(~A__CONV_~A~)(p) ((~A *)~
-                                    ~:[SOD_XCHAIN(~A, (p))~;(p)~])~%"
+            (format stream "#define ~:@(~A__CONV_~A~)(_obj) ((~A *)~
+                                    ~:[SOD_XCHAIN(~A, (_obj))~;(_obj)~])~%"
                     class (sod-class-nickname super) super
                     (eq chain-head super-head)
                     (sod-class-nickname super-head))))