Skip to content

Commit 2dcb103

Browse files
Remove atexit() function
1 parent 76363cf commit 2dcb103

File tree

3 files changed

+3
-68
lines changed

3 files changed

+3
-68
lines changed

CEdev/include/asm/cstartup.asm

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
.def _init
1515
.def _exit
1616
.def __exit
17-
.def ___atexit_registered
18-
.def ___atexit
1917

2018
define .header,space=ram
2119
define .icon,space=ram
@@ -59,33 +57,6 @@ _init:
5957
push hl
6058
ld (__errsp+1),sp ; save the stack from death
6159
call _main
62-
jr _xit
63-
64-
_exit: pop de
65-
pop hl
66-
_xit: ld de,_already_in_atexit
67-
ld a,(de)
68-
or a,a
69-
jr nz,__exit ; check to see if some idiot called exit()
70-
inc a
71-
ld (de),a
72-
push hl
73-
_lexit: ld hl,___atexit_registered
74-
ld a,(hl)
75-
or a,a
76-
jr z,__ee
77-
dec a
78-
ld (hl),a
79-
ld l,a
80-
ld h,3
81-
mlt hl
82-
ld bc,___atexit
83-
add hl,bc
84-
ld iy,(hl)
85-
call 00015Ch ; __indcall
86-
jr _lexit
87-
__ee: pop hl
88-
8960
__exit: ex de,hl
9061

9162
__errsp:
@@ -98,14 +69,10 @@ __errsp:
9869
pop iy ; restore iy for OS
9970
ex de,hl ; program return value in hl
10071
ret
72+
_exit: pop de
73+
pop de
74+
jr __errsp
10175
;-------------------------------------------------------------------------------
102-
segment bss
103-
___atexit:
104-
ds 96
105-
_already_in_atexit:
106-
ds 1
107-
___atexit_registered:
108-
ds 1
10976
segment code
11077
;-------------------------------------------------------------------------------
11178
; End Standard Startup Module

CEdev/include/lib/std/stdlib.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ void qsort(void * base,size_t nmemb,size_t size, int (*compar)(void * ,void * ))
8282
void abort(void);
8383
void exit(int status);
8484

85-
/* Called at exit, needs USE_AT_EXIT compiler flag */
86-
#define ATEXIT_MAX 32
87-
int atexit(void (*function)(void));
88-
8985
/* Absolutes and division */
9086
int abs(int j);
9187
long labs(long j);

CEdev/lib/src/std/shared/atexit.asm

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)