Commit 310b9433 authored by TASTE User's avatar TASTE User

Remove any reference to stdlib/stdio definitions

..for non-Unix targets
parent 49a6ebca
......@@ -41,7 +41,12 @@ void c_preamble(FV * fv)
fprintf(vm_if_h, "#ifndef VM_IF_%s\n", fv->name);
fprintf(vm_if_h, "#define VM_IF_%s\n\n", fv->name);
fprintf(vm_if, "#include <stdlib.h>\n" "#include <stdio.h>\n\n");
fprintf(vm_if, "#ifdef __unix__\n"
" #include <stdlib.h>\n"
" #include <stdio.h>\n"
"#else\n"
" typedef unsigned size_t;\n"
"#endif\n\n");
fprintf(vm_if_h, "#ifdef __cplusplus\n"
"extern \"C\" {\n" "#endif\n\n");
......@@ -59,7 +64,7 @@ void c_preamble(FV * fv)
}
if (hasparam) {
fprintf(vm_if, "#include \"C_ASN1_Types.h\"\n\n");
fprintf(vm_if, "#include \"C_ASN1_Types.h\"\n\n");
fprintf(vm_if_h, "#include \"C_ASN1_Types.h\"\n\n");
}
......@@ -571,8 +576,9 @@ void add_RI_to_c_invoke_ri(Interface * i)
"#ifdef __unix__\n"
" printf (\"** Encoding error in %s_RI_%s!!\\n\");\n"
"#endif\n"
" /* Major error, we must stop the application and let the FDIR/Watchdogs recover */\n"
" exit (-1);\n"
" /* Crash the application due to message loss */\n"
" extern void abort (void);\n"
" abort();\n"
" }\n",
p->name,
BINARY_ENCODING(p),
......
......@@ -49,7 +49,11 @@ void driver_gw_preamble(FV * fv)
"#ifndef __DRIVER_CODE_H_%s__\n#define __DRIVER_CODE_H_%s__\n\n",
fv->name, fv->name);
fprintf(driver_h, "#include <stdlib.h>\n\n");
fprintf(driver_h, "#ifdef __unix__\n"
" #include <stdlib.h>\n"
"#else\n"
" typedef unsigned size_t;\n"
"#endif\n\n");
fprintf(driver_h, "void init_%s();\n\n", fv->name);
......
......@@ -903,16 +903,16 @@ void Add_api(Process *node, FV_list *all_fv)
"#define __AUTO_CODE_H_%s__\n\n"
"#include \"C_ASN1_Types.h\"\n"
"#ifdef __cplusplus\n"
"extern \"C\" {\n"
" extern \"C\" {\n"
"#endif\n\n",
fv->name,
fv->name);
/* Debug mode - Unix platform, when env variable CHECKQ_DEBUG is set */
fprintf (header, "#ifdef __unix__\n"
"#include <stdbool.h>\n"
"#include <stdlib.h>\n"
"static bool debugCheckQ = false;\n"
" #include <stdbool.h>\n"
" #include <stdlib.h>\n"
" static bool debugCheckQ = false;\n"
"#endif\n\n");
fprintf (code, "#ifdef __unix__\n"
......@@ -952,9 +952,9 @@ void Add_api(Process *node, FV_list *all_fv)
" if (__po_hi_gqueue_get_count(%s, %s)) {\n"
" *res = 1;\n"
" #ifdef __unix__\n"
" if (debugCheckQ) {\n"
" printf (\"[DEBUG] Pending message %s in function %s\\n\");\n"
" }\n"
" if (debugCheckQ) {\n"
" printf (\"[DEBUG] Pending message %s in function %s\\n\");\n"
" }\n"
" #endif\n"
" }\n",
string_to_lower(task_id),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment