From b20313b7a1b92a2205779c051c1270461f057e7b Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 17 May 2015 16:23:52 +0100 Subject: [PATCH] libc: use the SDCC setjmp not one we inherited from somewhere The SDCC one saves the bits SDCC needs and so actually works with SDCC. It's also way smaller, cleaner and only uses legal instructions --- Library/include/setjmp.h | 4 +++- Library/libs/Makefile | 2 +- Library/tools/libclean | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Library/include/setjmp.h b/Library/include/setjmp.h index 479e4711..d240a752 100644 --- a/Library/include/setjmp.h +++ b/Library/include/setjmp.h @@ -7,7 +7,9 @@ /* FIXME: need to add alt registers */ typedef int jmp_buf[7]; -int setjmp __P((jmp_buf env)); +int __setjmp __P((jmp_buf env)); void longjmp __P((jmp_buf env, int rv)); +#define setjmp(x) __setjmp(x) + #endif diff --git a/Library/libs/Makefile b/Library/libs/Makefile index 92a469f8..deb83767 100644 --- a/Library/libs/Makefile +++ b/Library/libs/Makefile @@ -32,7 +32,7 @@ SRC_C += localtim.c localtim_r.c lseek.c lsearch.c lstat.c ltoa.c ltostr.c SRC_C += malloc.c mkfifo.c mkstemps.c nanosleep.c opendir.c pause.c perror.c SRC_C += popen.c printf.c putenv.c putgetch.c putpwent.c pwent.c qsort.c SRC_C += raise.c rand.c readdir.c readlink.c realloc.c regerror.c -SRC_C += regsub.c remove.c rewind.c rindex.c setbuffer.c setenv.c setjmp.c +SRC_C += regsub.c remove.c rewind.c rindex.c setbuffer.c setenv.c SRC_C += setlocale.c setvbuf.c settimeofday.c sleep.c sprintf.c SRC_C += stat.c stdio0.c stime.c SRC_C += strcasecmp.c strcasestr.c strdup.c stricmp.c strlcpy.c strncasecmp.c diff --git a/Library/tools/libclean b/Library/tools/libclean index 7a56b4a7..1f7d7931 100755 --- a/Library/tools/libclean +++ b/Library/tools/libclean @@ -20,7 +20,7 @@ cp ${SDCC_LIB}/z80/z80.lib tmp.lib # Need to review setjmp and maybe a couple of others # # -sdar d tmp.lib putchar.rel heap.rel fstubs.rel setjmp.rel errno.rel +sdar d tmp.lib putchar.rel heap.rel fstubs.rel errno.rel sdar d tmp.lib rand.rel _calloc.rel _malloc.rel _realloc.rel _free.rel sdar d tmp.lib printf_large.rel puts.rel gets.rel assert.rel time.rel sdar d tmp.lib tolower.rel toupper.rel _ltoa.rel _itoa.rel abs.rel -- 2.34.1