cloudahk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
cloudahk [2024-02-03 21:57] – Add Converter geekcloudahk [2024-02-08 02:01] (current) – Add compiler section geek
Line 48: Line 48:
     return     return
 </converter> </converter>
 +
 +===== Compiler =====
 +
 +Compile C code to an AHK-compatible loader function.
 +
 +<compiler>
 +#include <mcl.h>
 +
 +MCL_EXPORT(add, Int, a, Int, b, Cdecl_Int);
 +int add(int a, int b) {
 +    return a + b;
 +}
 +
 +MCL_EXPORT(sub, Int, a, Int, b, Cdecl_Int);
 +int sub(int a, int b) {
 +    return a - b;
 +}
 +
 +MCL_EXPORT(mul, Int, a, Int, b, Cdecl_Int);
 +int mul(int a, int b) {
 +    return a * b;
 +}
 +</compiler>
 +