alien.inline: added raw-c word
parent
79dd644e57
commit
c1ccc6a2b0
|
@ -106,8 +106,6 @@ HELP: RAW-C:
|
||||||
{ $syntax "RAW-C:" "body" ";" }
|
{ $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" } "." } ;
|
{ $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
|
HELP: compile-c-library
|
||||||
{ $description "Writes, compiles, and links code generated since last invocation of " { $link POSTPONE: define-c-library } ". "
|
{ $description "Writes, compiles, and links code generated since last invocation of " { $link POSTPONE: define-c-library } ". "
|
||||||
"Also calls " { $snippet "add-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" } "." } ;
|
{ $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"
|
ARTICLE: "alien.inline" "Inline C"
|
||||||
{ $vocab-link "alien.inline" }
|
{ $vocab-link "alien.inline" }
|
||||||
;
|
;
|
||||||
|
|
|
@ -122,6 +122,9 @@ PRIVATE>
|
||||||
[ [ define-c-library ] dip call compile-c-library ]
|
[ [ define-c-library ] dip call compile-c-library ]
|
||||||
[ cleanup-variables ] [ ] cleanup ; inline
|
[ cleanup-variables ] [ ] cleanup ; inline
|
||||||
|
|
||||||
|
: raw-c ( str -- )
|
||||||
|
[ "\n" % % "\n" % ] "" make c-strings get push ;
|
||||||
|
|
||||||
SYNTAX: C-LIBRARY: scan define-c-library ;
|
SYNTAX: C-LIBRARY: scan define-c-library ;
|
||||||
|
|
||||||
SYNTAX: COMPILE-AS-C++ t library-is-c++ set ;
|
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: DELETE-C-LIBRARY: scan delete-inline-library ;
|
||||||
|
|
||||||
SYNTAX: RAW-C:
|
SYNTAX: RAW-C: parse-here raw-c ;
|
||||||
[ "\n" % parse-here % "\n" % c-strings get push ] "" make ;
|
|
||||||
|
|
Loading…
Reference in New Issue