projects
/
mes.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mescc: Support gcc-3.0: Implement atexit.
[mes.git]
/
lib
/
linux-mini-gcc.c
diff --git
a/lib/linux-mini-gcc.c
b/lib/linux-mini-gcc.c
index da05ccf419a45ec62eb45ff29bf6b42fd7675000..3fe3829dfcd55545dadb850c988023300c084a6a 100644
(file)
--- a/
lib/linux-mini-gcc.c
+++ b/
lib/linux-mini-gcc.c
@@
-22,7
+22,7
@@
#define SYS_write "0x04"
void
#define SYS_write "0x04"
void
-exit (int code)
+
_
exit (int code)
{
#if !__TINYC__
asm (
{
#if !__TINYC__
asm (
@@
-42,7
+42,17
@@
exit (int code)
);
#endif // __TINYC__
// not reached
);
#endif // __TINYC__
// not reached
- exit (0);
+ _exit (0);
+}
+
+void (*__call_at_exit) (void);
+
+void
+exit (int code)
+{
+ if (__call_at_exit)
+ (*__call_at_exit) ();
+ _exit (code);
}
ssize_t
}
ssize_t