Unverified Commit f1edb2ab authored by Bernd Paysan's avatar Bernd Paysan Committed by GitHub

Merge pull request #23 from horttanainen/master

convert c strings into gforth addr u pairs when returning from c-function
parents bd6f6f14 feb3118b
......@@ -164,6 +164,10 @@ gforth_stackpointers gforth_libcc_init(GFORTH_ARGS)
: 0); \
} while (0);
#define c_str2gforth_str(str,addr,u) \
(addr) = (Char *) str; \
(u) = strlen(str);
#define gforth_ll2ud(ll,lo,hi) \
do { \
UClongest _ll = (ll); \
......
......@@ -522,6 +522,10 @@ create gen-call-types
: gen-wrapped-a ( pars c-name fp-change1 sp-change1 -- fp-change sp-change )
2dup gen-par-sp 2>r ." =(Cell)" gen-wrapped-call 2r> ;
: gen-wrapped-s ( pars c-name fp-change1 sp-change1 -- fp-change sp-change )
." c_str2gforth_str(" gen-wrapped-void
." ," gen-par-sp ." ," gen-par-sp ." )" ;
: gen-wrapped-d ( pars c-name fp-change1 sp-change1 -- fp-change sp-change )
." gforth_ll2d(" gen-wrapped-void
." ," gen-par-sp ." ," gen-par-sp ." )" ;
......@@ -545,7 +549,7 @@ create gen-wrapped-types
' gen-wrapped-r ,
' gen-wrapped-func ,
' gen-wrapped-void ,
' gen-wrapped-a ,
' gen-wrapped-s ,
' gen-wrapped-a ,
' gen-wrapped-void ,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment