forked from KolibriOS/kolibrios
## New functions:
+ implement `_exit`/`_Exit`.
+ implement `atexit`.
+ implement `abort`.
`abort` write `Aborted pid: %d` to debug board
## Changes:
### call `exit` after main.
Just calling `exit`
### `exit` write exit code
If exit code isn't 0 `exit` will write exit code to debug board.
### use `con_exit(0)`
use
```c
con_exit(0)
```
instead of
```c
con_exit(status);
```
[from console.obj readme](310999dcc4/programs/develop/libraries/console_coff/console_en.txt (L15)).
I think the console window shouldn't be so dependent on the exit code. It's must only always close or always stay on screen
### `exit` writing exit code to debug board
Since the exit code is not used anywhere right now, I think it's better to just show it on the debug board.
for auto rebuild `crt0.o` need #339
from #311
---------
Co-authored-by: Burer <burer@kolibrios.org>
Reviewed-on: KolibriOS/kolibrios#340
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Reviewed-by: Burer <burer@kolibrios.org>
Co-authored-by: Egor00f <y.yarin@inbox.ru>
Co-committed-by: Egor00f <y.yarin@inbox.ru>
46 lines
848 B
Makefile
46 lines
848 B
Makefile
KTCC = kos32-tcc
|
|
FASM = fasm
|
|
KPACK = kpack
|
|
|
|
CFLAGS = -I../include -B../../bin -I../../../../../contrib/sdk/sources/SDL-1.2.2_newlib/include
|
|
LIBS = -lbox_lib -lshell -lSDL -lsound -lnetwork -lrasterworks -limg -ldialog -lmsgbox
|
|
|
|
BIN = \
|
|
stdio_test.kex \
|
|
basic_gui.kex \
|
|
http_tcp_demo.kex \
|
|
math_test.kex \
|
|
string_test.kex \
|
|
whois.kex \
|
|
file_io.kex \
|
|
tmpdisk_work.kex \
|
|
consoleio.kex \
|
|
assert_test.kex \
|
|
clayer/rasterworks.kex \
|
|
clayer/libimg.kex \
|
|
clayer/dialog.kex \
|
|
clayer/msgbox.kex \
|
|
clayer/boxlib.kex \
|
|
thread_work.kex \
|
|
sdltest.kex \
|
|
shell_test.kex \
|
|
libc_test.kex \
|
|
pipe.kex \
|
|
defgen.kex \
|
|
futex.kex \
|
|
atexit_test.kex \
|
|
abort_test.kex
|
|
|
|
all: $(BIN)
|
|
|
|
%.kex : %.c
|
|
$(KTCC) $(CFLAGS) $(LDFLAGS) $< -o $@ $(LIBS)
|
|
$(KPACK) --nologo $@
|
|
|
|
%.kex : %.asm
|
|
$(FASM) $< $@
|
|
$(KPACK) --nologo $@
|
|
|
|
clean:
|
|
rm *.kex clayer/*.kex
|