From e0be8da8a176bcc2049fe1fcb7c1c7b8b7b72b32 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 12 Nov 2009 17:24:18 +0000 Subject: [PATCH] some fixes svn: r16732 --- collects/mzscheme/examples/curses-demo.ss | 7 +------ collects/mzscheme/examples/curses.c | 9 +++++++-- collects/mzscheme/examples/hello.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/collects/mzscheme/examples/curses-demo.ss b/collects/mzscheme/examples/curses-demo.ss index b307c18c56..e016682802 100644 --- a/collects/mzscheme/examples/curses-demo.ss +++ b/collects/mzscheme/examples/curses-demo.ss @@ -1,8 +1,7 @@ - ; Uses the curses.so extension. Run with ; mzscheme -r curses-demo.ss -; To get append-extension-suffix, which adds .so or .ddl as +; To get append-extension-suffix, which adds .so or .dll as ; approrpiate for the current platform: (require dynext/file) @@ -17,7 +16,3 @@ (refresh) (get) - - - - diff --git a/collects/mzscheme/examples/curses.c b/collects/mzscheme/examples/curses.c index fa20e21f18..0efe0c3f14 100644 --- a/collects/mzscheme/examples/curses.c +++ b/collects/mzscheme/examples/curses.c @@ -2,7 +2,9 @@ Extension that uses the curses library. Link the extension to the curses library like this: - mzc --ld hello.so hello.o -lcurses + mzc --xform curses.c + mzc --3m --cc curses.3m.c + mzc --3m --ld curses.so curses_3m.o -lcurses For obvious reasons, this library doesn't interact well with MzScheme's read-eval-print loop. The example file @@ -39,7 +41,8 @@ static Scheme_Object *sch_put(int argc, Scheme_Object **argv) static Scheme_Object *sch_get(int argc, Scheme_Object **argv) { /* Gets keyboard input */ - int c = getch(); + int c; + c = getch(); return scheme_make_character(c); } @@ -84,9 +87,11 @@ Scheme_Object *scheme_reload(Scheme_Env *env) allocating call. They're not needed for plain old (conservatively collected) Mzscheme. See makeadder3m.c for more info. */ Scheme_Object *v; + /* Old annotations, are they needed? MZ_GC_DECL_REG(1); MZ_GC_VAR_IN_REG(0, env); MZ_GC_REG(); + */ v = scheme_make_prim_w_arity(sch_clear, "clear", 0, 0), scheme_add_global("clear", v, env); diff --git a/collects/mzscheme/examples/hello.c b/collects/mzscheme/examples/hello.c index 53d3289bbd..8d6fa3af91 100644 --- a/collects/mzscheme/examples/hello.c +++ b/collects/mzscheme/examples/hello.c @@ -2,10 +2,10 @@ MzScheme extension example that returns the string "Hello, world!" when loaded. - For 3m, compile with: + For the 3m GC (the default), compile with: mzc --xform hello.c mzc --3m --cc hello.3m.c - mzc --3m --ld hello.so hello.o + mzc --3m --ld hello.so hello_3m.o And load with (load-extension "hello.so") ; or "hello.dylib" for Mac OS X ; or "hello.dll" for Windows