chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] unbound variable: foreign-code


From: Alex Shinn
Subject: Re: [Chicken-users] unbound variable: foreign-code
Date: Wed, 29 Dec 2004 08:08:03 -0600
User-agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI)

At Wed, 29 Dec 2004 11:46:07 +0000, Tony Garnock-Jones wrote:
> 
> I guess it could be improved by only compiling in sdl-init on non-MacOS 
> X platforms; is there an easy way of doing platform-specific conditional 
> compilation with Chicken? (I suppose if not I could do a platform test 
> at runtime.)

I'm currently developing an SDL app on both Linux and OS X.  To keep
the same source file usable on both platforms, I add

  -feature compile-sdl

to the csc options in the Makefile, then in the main function I do

  (cond-expand
    (compile-sdl
     (declare (foreign-declare "#include \"SDL.h\"\n"))
     (foreign-code "SDL_Init(SDL_INIT_EVERYTHING);"))
    (else
     (sdl-init sdl_init_everything)))

and that way on Linux I can either build the project or just run
./myapp.scm as a script (handy for testing quick changes), and on OS X
I just always build the binary.

-- 
Alex




reply via email to

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