chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] compiler crashes 1.51


From: Eric Merritt
Subject: [Chicken-users] compiler crashes 1.51
Date: Wed, 16 Jun 2004 07:59:42 -0700 (PDT)

Guys,

  This bit of code seams to reliably crash the chicken
compiler. I am new to both chicken and scheme (though
I have played a very small bit with cl), so its not
surprising that I came up with some bad code, however,
the compiler should probably return an error message
instead of crashing ;) 


-----------scheme-code--------------

#>

# include "SDL/SDL.h"

<#

(define-macro (define-foreign-struct long-name .
slots)
  (let* ((name (cadr long-name))
         (sname (symbol->string name))
         (type (car long-name))
         (stype (symbol->string type))
         (oname (gensym))
         (var (gensym))
         (setvar (gensym)))
    `(begin
       (define-foreign-type (,name) 
         (pointer ,(string-append 
                    "" stype "")))
       (define ,(string->symbol (string-append 
                                 "make-" sname))
         (foreign-lambda* ,name ()
                          ,(string-append 
                            "return (("
                            stype " *) malloc(sizeof("
                            stype ")));"))))))
                                                    
          

(define-foreign-type Uint8 unsigned-char)
(define-foreign-type Sint8 char)
(define-foreign-type Uint16 unsigned-short)
(define-foreign-type Sint16 short)
(define-foreign-type Uint32 unsigned-int)
(define-foreign-type Sint32 int)

(define-foreign-struct (SDL_Rect rect) 
  ((Sint16 x)
   (Sint16 y)
   (Uint16 w)
   (Uint16 h)))

(define-foreign-struct (SDL_VideoInfo video-info) ())

(define-foreign-struct (SDL_Surface surface) ())



                
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail




reply via email to

[Prev in Thread] Current Thread [Next in Thread]