Hi,

The following diff from upstream CVS should fix this.  However, I've
not managed to regenerate src/autoloads.c such that it will compile
(using installed gosh and the the rules in src/Makefile).


Regards,
Roger


===================================================================
RCS file: /cvsroot/gauche/Gauche/lib/gauche/cgen.scm,v
retrieving revision 1.8
retrieving revision 1.10
diff -u -r1.8 -r1.10
--- gauche/Gauche/lib/gauche/cgen.scm   2005/05/30 07:50:12     1.8
+++ gauche/Gauche/lib/gauche/cgen.scm   2005/06/16 07:45:35     1.10
@@ -30,7 +30,7 @@
 ;;;   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 ;;;   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ;;;  
-;;;  $Id: cgen.scm,v 1.8 2005/05/30 07:50:12 shirok Exp $
+;;;  $Id: cgen.scm,v 1.10 2005/06/16 07:45:35 shirok Exp $
 ;;;
 
 ;; *EXPERIMENTAL*
@@ -148,7 +148,7 @@
    (c-file   :init-keyword :c-file :init-value #f)
    (h-file   :init-keyword :h-file :init-value #f)
    (preamble :init-keyword :preamble
-             :init-value '("/* Generated by gauche.cgen $Revision: 1.8 $ */"))
+             :init-value '("/* Generated by gauche.cgen $Revision: 1.10 $ */"))
    (pre-decl :init-keyword :pre-decl :init-value '())
    (init-prologue :init-keyword :init-prologue :init-value #f)
    (init-epilogue :init-keyword :init-epilogue :init-value #f)
@@ -277,11 +277,15 @@
       (let1 count (ref dl 'count)
         (slot-push! dl 'init-thunks ithunk)
         (inc! (ref dl 'count))
-        (format "SCM_OBJ(~a~a.~a[~a])"
-                (if value-type? "" "&")
-                (static-data-c-struct-name category)
-                (ref dl 'c-member-name)
-                count)))))
+        (if value-type?
+          (format "~a.~a[~a]" ; no cast, for this'll be also used as lvalue.
+                  (static-data-c-struct-name category)
+                  (ref dl 'c-member-name)
+                  count)
+          (format "SCM_OBJ(&~a.~a[~a])"
+                  (static-data-c-struct-name category)
+                  (ref dl 'c-member-name)
+                  count))))))
 
 (define (cgen-allocate-static-array category c-type init-thunks)
   (fold (lambda (init-thunk seed)
@@ -880,9 +884,13 @@
 (define (cgen-with-output-file file thunk)
   (receive (port tmpfile) (sys-mkstemp file)
     (with-error-handler
-        (lambda (e) (sys-unlink tmpfile) (raise e))
+        (lambda (e)
+          (close-output-port port)
+          (sys-unlink tmpfile)
+          (raise e))
       (lambda ()
         (with-output-to-port port thunk)
+        (close-output-port port)
         (sys-rename tmpfile file)))))
 
 (define cgen-unique-name



-- 
Roger Leigh
                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to