2022-01-21 21:02:23 +01:00
|
|
|
/* Copyright (C) World
|
|
|
|
* a native printf is provided by the builtin libc of wamr */
|
2020-11-26 16:18:48 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2022-01-21 21:02:23 +01:00
|
|
|
extern "C" int printf( const char *, ...);
|
2020-11-26 16:18:48 +01:00
|
|
|
#define WASM_EXPORT __attribute__((visibility("default"))) extern "C"
|
|
|
|
#else
|
2022-01-21 21:02:23 +01:00
|
|
|
extern int printf( const char *, ...);
|
2020-11-26 16:18:48 +01:00
|
|
|
#define WASM_EXPORT __attribute__((visibility("default")))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
WASM_EXPORT int main(int argc, char **argv)
|
|
|
|
{
|
2022-01-21 21:02:23 +01:00
|
|
|
if (argc > 1) {
|
|
|
|
printf("Hello %s %i\n", argv[1], 2001);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
printf("Hello %s %i\n", "RIOT", 2001);
|
|
|
|
}
|
2020-11-26 16:18:48 +01:00
|
|
|
return 2468;
|
|
|
|
}
|