meke.py 使用命令行传入源文件
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "string.h"
|
||||
#include "main.h"
|
||||
#include "lambda.h"
|
||||
#include "debug.h"
|
||||
|
||||
typedef struct test_struct{
|
||||
int a;
|
||||
@@ -24,7 +25,7 @@ lambda_use
|
||||
|
||||
void run_callback(int (*fun)(int a, int b)) {
|
||||
int a = fun(1, 2);
|
||||
printf("a = %d\n", a);
|
||||
DBG_LOG("a = %d\n", a);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,30 +51,30 @@ int thread_fun(void* t)
|
||||
{
|
||||
void (*fun1)(int a, int b);
|
||||
fun1 = lambda(void(int a, int b) {
|
||||
printf("a = %d, b = %d\n", a, b);
|
||||
DBG_LOG("a = %d, b = %d\n", a, b);
|
||||
});
|
||||
fun1(1, 2);
|
||||
void (*fun2)(int a, int b);
|
||||
fun2 = lambda(void(int a, int b) {
|
||||
printf("a = %d, b = %d a*b=%d\n", a, b, a * b);
|
||||
DBG_LOG("a = %d, b = %d a*b=%d\n", a, b, a * b);
|
||||
});
|
||||
fun2(3, 4);
|
||||
void (*fun3)(void);
|
||||
fun3 = lambda(void(void) {
|
||||
int a = 3;
|
||||
int b = 4;
|
||||
printf("a = %d, b = %d a*b=%d\n", a, b, a * b);
|
||||
DBG_LOG("a = %d, b = %d a*b=%d\n", a, b, a * b);
|
||||
});
|
||||
fun3();
|
||||
void (*fun4)();
|
||||
fun4 = lambda(void() {
|
||||
int a = 5, b = 6;
|
||||
printf("a = %d, b = %d a*b=%d\n", a, b, a * b);
|
||||
DBG_LOG("a = %d, b = %d a*b=%d\n", a, b, a * b);
|
||||
});
|
||||
fun4();
|
||||
unsigned int (*fun5)(int a, int b);
|
||||
fun5 = lambda(unsigned int (int a,int b) {
|
||||
printf("a = %d, b = %d a*b=%d\n", a, b, a * b);
|
||||
DBG_LOG("a = %d, b = %d a*b=%d\n", a, b, a * b);
|
||||
return 6;
|
||||
});
|
||||
fun5(3, 4);
|
||||
@@ -85,9 +86,9 @@ int thread_fun(void* t)
|
||||
return a * b * 10;
|
||||
}));
|
||||
|
||||
printf("test_struct_var.sub(1,2) = %d\n", test_struct_var.sub(1, 2));
|
||||
printf("test_struct_var.add(1,2) = %d\n", test_struct_var.add(1, 2));
|
||||
printf("test_struct_var.sum(&test_struct_var) = %d\n", test_struct_var.sum(&test_struct_var));
|
||||
DBG_LOG("test_struct_var.sub(1,2) = %d\n", test_struct_var.sub(1, 2));
|
||||
DBG_LOG("test_struct_var.add(1,2) = %d\n", test_struct_var.add(1, 2));
|
||||
DBG_LOG("test_struct_var.sum(&test_struct_var) = %d\n", test_struct_var.sum(&test_struct_var));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user