diff options
author | Jean-Paul Mari <djipi.mari@gmail.com> | 2025-06-27 06:57:15 -0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2025-08-04 11:39:58 +0200 |
commit | 22580ced9ac9af2a1e3068863bebecf738e33458 (patch) | |
tree | b64d72e0ee6d0293c27c89377e1b57a8c69d0f34 | |
parent | d61692cbd03baf863b91d23bb3816ce2e891dcc2 (diff) | |
download | newlib-22580ced9ac9af2a1e3068863bebecf738e33458.zip newlib-22580ced9ac9af2a1e3068863bebecf738e33458.tar.gz newlib-22580ced9ac9af2a1e3068863bebecf738e33458.tar.bz2 |
Fix missing declarations in libgloss m68k
This patch adds missing function declarations in several m68k-specific
libgloss source files. This helps avoid implicit declaration compiler
warnings / errors and ensures better portability.
Tested by building newlib for m68k-elf with GCC.
-rw-r--r-- | libgloss/m68k/leds.c | 2 | ||||
-rw-r--r-- | libgloss/m68k/mc68ec.c | 2 | ||||
-rw-r--r-- | libgloss/m68k/sim-abort.c | 3 | ||||
-rw-r--r-- | libgloss/m68k/sim-funcs.c | 1 | ||||
-rw-r--r-- | libgloss/m68k/sim-inbyte.c | 2 | ||||
-rw-r--r-- | libgloss/m68k/sim-print.c | 2 | ||||
-rw-r--r-- | libgloss/m68k/sim-sbrk.c | 2 |
7 files changed, 13 insertions, 1 deletions
diff --git a/libgloss/m68k/leds.c b/libgloss/m68k/leds.c index b911237..9690476 100644 --- a/libgloss/m68k/leds.c +++ b/libgloss/m68k/leds.c @@ -15,6 +15,8 @@ */ #include "leds.h" +extern void delay(int); + /* * led_putnum -- print a hex number on the LED. the value of num must be a char with * the ascii value. ie... number 0 is '0', a is 'a', ' ' (null) clears diff --git a/libgloss/m68k/mc68ec.c b/libgloss/m68k/mc68ec.c index 76e737f..5543def 100644 --- a/libgloss/m68k/mc68ec.c +++ b/libgloss/m68k/mc68ec.c @@ -25,7 +25,7 @@ * prompt. It can be restarted from there. */ void -_exit (int_status) +_exit (int status) { /* Use `i' constraint to get proper immediate-operand syntax for target assembler configuration. */ diff --git a/libgloss/m68k/sim-abort.c b/libgloss/m68k/sim-abort.c index 4960de8..affc2c6 100644 --- a/libgloss/m68k/sim-abort.c +++ b/libgloss/m68k/sim-abort.c @@ -14,6 +14,9 @@ * they apply. */ +#include <stdlib.h> +#include <unistd.h> + void abort(void) { write (2, "Abort called.\n", sizeof("Abort called.\n")-1); diff --git a/libgloss/m68k/sim-funcs.c b/libgloss/m68k/sim-funcs.c index 712c566..865e752 100644 --- a/libgloss/m68k/sim-funcs.c +++ b/libgloss/m68k/sim-funcs.c @@ -15,6 +15,7 @@ #define _XOPEN_SOURCE #include <unistd.h> +#include <stdlib.h> int kill(int pid, int sig) diff --git a/libgloss/m68k/sim-inbyte.c b/libgloss/m68k/sim-inbyte.c index 3fa3f24..7d2c972 100644 --- a/libgloss/m68k/sim-inbyte.c +++ b/libgloss/m68k/sim-inbyte.c @@ -14,6 +14,8 @@ * they apply. */ +#include <unistd.h> + int inbyte () { diff --git a/libgloss/m68k/sim-print.c b/libgloss/m68k/sim-print.c index 18ca022..907c541 100644 --- a/libgloss/m68k/sim-print.c +++ b/libgloss/m68k/sim-print.c @@ -13,6 +13,8 @@ * they apply. */ +#include <unistd.h> + /* * print -- do a raw print of a string */ diff --git a/libgloss/m68k/sim-sbrk.c b/libgloss/m68k/sim-sbrk.c index 83e5287..771eecf 100644 --- a/libgloss/m68k/sim-sbrk.c +++ b/libgloss/m68k/sim-sbrk.c @@ -14,6 +14,8 @@ * they apply. */ +extern int brk(void *addr); + extern char _end[]; static char *curbrk = _end; |