-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathstdapi.cpp
44 lines (38 loc) · 1.03 KB
/
stdapi.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//=====================================================================//
/*! @file
@brief stdc++ ライブラリの補助 @n
libsupc++ ランタイムが最低限必要な関数、定義など
@author 平松邦仁 ([email protected])
@copyright Copyright (C) 2018, 2024 Kunihito Hiramatsu @n
Released under the MIT license @n
https://github.com/hirakuni45/glfw_app/blob/master/LICENSE
*/
//=====================================================================//
#include <cstdlib>
extern "C" {
void sci_puts(const char *) __attribute__((weak));
void sci_puts(const char *) { }
void kill(int pid, int sig) __attribute__((weak));
void kill(int pid, int sig) { }
int getpid() __attribute__((weak));
int getpid() { return 1; }
}
namespace std {
void __throw_bad_function_call()
{
sci_puts("bad_function_call\n");
abort();
}
void __throw_bad_alloc()
{
sci_puts("bad_alloc\n");
abort();
}
#if 0
void __throw_length_error(char const*e)
{
Serial.print("Length Error :");
Serial.println(e);
}
#endif
}