void __do_exit(int rv)
{
- register int count = __on_exit_count - 1;
- register vfuncp ptr;
+ /* Static to work around a bug in cc65 */
+ static int count;
+ vfuncp ptr;
+
+ count = __on_exit_count - 1;
__on_exit_count = -1; /* ensure no more will be added */
/* In reverse order */
; Call the module destructors. This is also the exit() entry.
- jmp _exit ; exit syscall, AX holds our return code
+ jmp _exit ; exit cleanup, AX holds our return code
; for a fastcall return to nowhere.
initmainargs: ; Hardcoded compiler dumbness