1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/examples/wasm/wasm_sample/hello.c
Karl Fessel 51c94a1217 example/wasm: simplify example extend sample
* uneventise example
2022-02-11 13:29:40 +01:00

22 lines
533 B
C

/* Copyright (C) World
* a native printf is provided by the builtin libc of wamr */
#ifdef __cplusplus
extern "C" int printf( const char *, ...);
#define WASM_EXPORT __attribute__((visibility("default"))) extern "C"
#else
extern int printf( const char *, ...);
#define WASM_EXPORT __attribute__((visibility("default")))
#endif
WASM_EXPORT int main(int argc, char **argv)
{
if (argc > 1) {
printf("Hello %s %i\n", argv[1], 2001);
}
else {
printf("Hello %s %i\n", "RIOT", 2001);
}
return 2468;
}