File tree Expand file tree Collapse file tree 7 files changed +23
-8
lines changed Expand file tree Collapse file tree 7 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 21
21
22
22
如果想向其中添加其余函数:
23
23
24
- - C\C++: [ 详见添加方法] ( ./command/c_build/README.md )
24
+ - C\C++: [ 详见添加方法] ( ./command/src/ c_build/README.md )
25
25
- rust: [ 详间rust添加方法] ( ./command/src/commands/README.md )
26
26
27
27
## 功能特点
Original file line number Diff line number Diff line change @@ -23,3 +23,15 @@ fn main() {
23
23
// init shell
24
24
init_shell ( & mut session_context)
25
25
}
26
+
27
+ /* C test
28
+ #[link(name="hello")]
29
+ extern "C"{
30
+ fn hello();
31
+ }
32
+
33
+ fn main(){
34
+ unsafe{
35
+ hello()
36
+ }
37
+ }*/
Original file line number Diff line number Diff line change 1
1
fn main ( ) {
2
- // file: c_build/your.c\
2
+ // file: ./src/ c_build/c/ your.c
3
3
// compile: your function name
4
+ // if your function is cpp, you can {.cpp(true)}
4
5
cc:: Build :: new ( )
5
- . file ( "" ) ;
6
+ . file ( "./src/c_build/c/example.c" )
7
+ . compile ( "hello" ) ;
6
8
}
Load Diff This file was deleted.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ #include <stdio.h>
2
+
3
+
4
+ void hello (){
5
+ printf ("welcome to 'C' \n" );
6
+ }
You can’t perform that action at this time.
0 commit comments