alien.inline: added raw-c word
parent
79dd644e57
commit
c1ccc6a2b0
|
@ -106,8 +106,6 @@ HELP: RAW-C:
|
|||
{ $syntax "RAW-C:" "body" ";" }
|
||||
{ $description "Insert a string into the generated source file. Useful for macros and other details not implemented in " { $snippet "alien.inline" } "." } ;
|
||||
|
||||
CONSTANT: foo "abc"
|
||||
|
||||
HELP: compile-c-library
|
||||
{ $description "Writes, compiles, and links code generated since last invocation of " { $link POSTPONE: define-c-library } ". "
|
||||
"Also calls " { $snippet "add-library" } ". "
|
||||
|
@ -206,6 +204,10 @@ HELP: with-c-library
|
|||
}
|
||||
{ $description "Calls " { $link define-c-library } ", then the quotation, then " { $link compile-c-library } ", then sets all variables bound by " { $snippet "define-c-library" } " to " { $snippet "f" } "." } ;
|
||||
|
||||
HELP: raw-c
|
||||
{ $values { "str" string } }
|
||||
{ $description "Insert a string into the generated source file. Useful for macros and other details not implemented in " { $snippet "alien.inline" } "." } ;
|
||||
|
||||
ARTICLE: "alien.inline" "Inline C"
|
||||
{ $vocab-link "alien.inline" }
|
||||
;
|
||||
|
|
|
@ -122,6 +122,9 @@ PRIVATE>
|
|||
[ [ define-c-library ] dip call compile-c-library ]
|
||||
[ cleanup-variables ] [ ] cleanup ; inline
|
||||
|
||||
: raw-c ( str -- )
|
||||
[ "\n" % % "\n" % ] "" make c-strings get push ;
|
||||
|
||||
SYNTAX: C-LIBRARY: scan define-c-library ;
|
||||
|
||||
SYNTAX: COMPILE-AS-C++ t library-is-c++ set ;
|
||||
|
@ -146,5 +149,4 @@ SYNTAX: ;C-LIBRARY compile-c-library ;
|
|||
|
||||
SYNTAX: DELETE-C-LIBRARY: scan delete-inline-library ;
|
||||
|
||||
SYNTAX: RAW-C:
|
||||
[ "\n" % parse-here % "\n" % c-strings get push ] "" make ;
|
||||
SYNTAX: RAW-C: parse-here raw-c ;
|
||||
|
|
Loading…
Reference in New Issue