Skip to content

Commit a302ba1

Browse files
facchinmsoburi
authored andcommitted
loader: impl: add some libc/::std functions
1 parent 9520860 commit a302ba1

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

cores/arduino/abi.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,22 @@ extern "C" int __cxa_atexit(void (*func) (void *), void * arg, void * dso_handle
1212
(void)func; (void)arg; (void)dso_handle; // unused
1313
return 0;
1414
}
15+
extern "C" int atexit(void (*func)(void)) {
16+
(void)func;
17+
return 0;
18+
}
1519

1620
namespace std {
17-
[[gnu::weak, noreturn]] void terminate() {
18-
abort();
21+
void __throw_length_error(const char* __s __attribute__((unused))) {}
22+
void __throw_bad_alloc() {}
23+
void __throw_bad_function_call() {}
24+
};
25+
26+
extern "C" int strcmp(const char* s1, const char* s2) {
27+
while(*s1 && (*s1 == *s2))
28+
{
29+
s1++;
30+
s2++;
1931
}
2032
}
2133

0 commit comments

Comments
 (0)