crust the rust c header file
This commit is contained in:
commit
9e85522619
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
a.out
|
9
main.c
Normal file
9
main.c
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "rust.h"
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let_mut_int a = 7;
|
||||||
|
print("Hello, World!\n");
|
||||||
|
a += 1;
|
||||||
|
Ok();
|
||||||
|
}
|
17
rust.h
Normal file
17
rust.h
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#define fn int
|
||||||
|
#define let_int const int
|
||||||
|
#define let_float const float
|
||||||
|
#define let_bool const bool
|
||||||
|
#define let_char const char
|
||||||
|
|
||||||
|
#define let_mut_int int
|
||||||
|
#define let_mut_float float
|
||||||
|
#define let_mut_bool bool
|
||||||
|
#define let_mut_char char
|
||||||
|
|
||||||
|
#define print printf
|
||||||
|
#define loop while(true)
|
||||||
|
#define Ok(); return 0
|
||||||
|
#define Err(); return 1
|
Loading…
Reference in a new issue