Commit f126a1ab authored by Kevin Bracey's avatar Kevin Bracey
Browse files

* __assert2() added to support for C99 assert(), which displays function name.

* _Exit() added.
* Lots of new <math.h> functions (acosh, asinh, atanh, exp2, expm1,
  ilogb, log1p, log2, logb, scalbn, scalbln, cbrt, erf, erfc,
  lgamma, tgamma, nexttoward, fmaf). Float and long double forms
  of every function added; long double forms are included as another
  library object in the stubs rather than the shared library, as they
  just branch to the double form.
* Subnormal/NaN/infinity cases in various <math.h> functions improved.
* Added <tgmath.h>.
* Headers brought into line with CC 5.54.
* RMEnsures added to C library initialisation to try to load minimum
  CallASWI, FPEmulator, CLib. No errors reported if load fails.
* A few pointless inter-file dependencies removed to reduce minimum
  size of included ANSILib.

Version 5.46. Tagged as 'RISC_OSLib-5_46'
parent eb77aba9
......@@ -15,4 +15,4 @@ To make Shared C Library compatible with 32-bit RISC OS, build with APCS = APCS-
An APCS-32 Shared C Library will NOT run 26-bit programs, even on a 26-bit
system; an APCS-R Shared C Library must be used. In a build using APCS-32,
the SCL must be forced to APCS-R - pass the option SCL_APCS="-APCS 3/26bit"
in the components file to acheive this.
in the components file to achieve this.
......@@ -181,6 +181,7 @@ HEADERS =\
CLIB:h.stdlib \
CLIB:h.string \
CLIB:h.swis \
CLIB:h.tgmath \
CLIB:h.time \
CLIB:h.varargs \
RISC_OSLib:h.akbd \
......@@ -278,7 +279,7 @@ ANSI_OBJS =\
o.alloc o.armprof o.armsys o.clib o.ctype o.error o.fpprintf \
o.kernel o.locale o.math o.memcpset o.overmgr o.printf o.scanf \
o.signal o.sort o.stdio o.stdlib o.string o.swiv o.time o.fenv \
o.longlong
o.longlong o.mathl
RM_OBJS =\
rm_o.k_modbody \
......@@ -587,17 +588,17 @@ rm_o.k_stub2_rm: kernel.s.k_stub2_rm
rm_o_rl.rl_stub_rm: rlib.s.rl_stub_rm
${OBJASM} ${ALFLAGS} -from rlib.s.rl_stub_rm -to $@
lib.stubs: o.cl_stub_r o.k_stub2_r o.cl_stub2_r
${LIBFILE} ${LIBFLAGS} $@ o.cl_stub_r o.k_stub2_r o.cl_stub2_r
lib.stubs: o.cl_stub_r o.k_stub2_r o.cl_stub2_r o.mathl
${LIBFILE} ${LIBFLAGS} $@ o.cl_stub_r o.k_stub2_r o.cl_stub2_r o.mathl
lib.rstubs: o_rl.rl_stub_r o.k_stub2_r o.cl_stub2_r
${LIBFILE} ${LIBFLAGS} $@ o_rl.rl_stub_r o.k_stub2_r o.cl_stub2_r
lib.rstubs: o_rl.rl_stub_r o.k_stub2_r o.cl_stub2_r o.mathl
${LIBFILE} ${LIBFLAGS} $@ o_rl.rl_stub_r o.k_stub2_r o.cl_stub2_r o.mathl
lib.romcstubs: rm_o.cl_stub_rm rm_o.k_stub2_rm rm_o.cl_stub2_rm
${LIBFILE} ${LIBFLAGS} $@ rm_o.cl_stub_rm rm_o.k_stub2_rm rm_o.cl_stub2_rm
lib.romcstubs: rm_o.cl_stub_rm rm_o.k_stub2_rm rm_o.cl_stub2_rm o.mathl
${LIBFILE} ${LIBFLAGS} $@ rm_o.cl_stub_rm rm_o.k_stub2_rm rm_o.cl_stub2_rm o.mathl
lib.romstubs: rm_o_rl.rl_stub_rm rm_o.k_stub2_rm rm_o.cl_stub2_rm
${LIBFILE} ${LIBFLAGS} $@ rm_o_rl.rl_stub_rm rm_o.k_stub2_rm rm_o.cl_stub2_rm
lib.romstubs: rm_o_rl.rl_stub_rm rm_o.k_stub2_rm rm_o.cl_stub2_rm o.mathl
${LIBFILE} ${LIBFLAGS} $@ rm_o_rl.rl_stub_rm rm_o.k_stub2_rm rm_o.cl_stub2_rm o.mathl
lib.romastubs: rlib.s.rl_stub_a
${OBJASM} ${AFLAGS} -from rlib.s.rl_stub_a -to $@
......@@ -648,6 +649,7 @@ CLIB:h.stdint: clib.h.stdint; ${CP} clib.h.stdint $@ ${CPFLAGS}
CLIB:h.stdio: clib.h.stdio; ${CP} clib.h.stdio $@ ${CPFLAGS}
CLIB:h.stdlib: clib.h.stdlib; ${CP} clib.h.stdlib $@ ${CPFLAGS}
CLIB:h.string: clib.h.string; ${CP} clib.h.string $@ ${CPFLAGS}
CLIB:h.tgmath: clib.h.tgmath; ${CP} clib.h.tgmath $@ ${CPFLAGS}
CLIB:h.time: clib.h.time; ${CP} clib.h.time $@ ${CPFLAGS}
CLIB:h.varargs: clib.h.varargs; ${CP} clib.h.varargs $@ ${CPFLAGS}
......
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.45"
Module_Version SETA 545
Module_MajorVersion SETS "5.46"
Module_Version SETA 546
Module_MinorVersion SETS ""
Module_Date SETS "17 Jan 2003"
Module_ApplicationDate SETS "17-Jan-03"
Module_Date SETS "15 Apr 2003"
Module_ApplicationDate SETS "15-Apr-03"
Module_ComponentName SETS "RISC_OSLib"
Module_ComponentPath SETS "RiscOS/Sources/Lib/RISC_OSLib"
Module_FullVersion SETS "5.45"
Module_HelpVersion SETS "5.45 (17 Jan 2003)"
Module_FullVersion SETS "5.46"
Module_HelpVersion SETS "5.46 (15 Apr 2003)"
END
/* (5.45)
/* (5.46)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.68.
*
*/
#define Module_MajorVersion_CMHG 5.45
#define Module_MajorVersion_CMHG 5.46
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 17 Jan 2003
#define Module_Date_CMHG 15 Apr 2003
#define Module_MajorVersion "5.45"
#define Module_Version 545
#define Module_MajorVersion "5.46"
#define Module_Version 546
#define Module_MinorVersion ""
#define Module_Date "17 Jan 2003"
#define Module_Date "15 Apr 2003"
#define Module_ApplicationDate "17-Jan-03"
#define Module_ApplicationDate "15-Apr-03"
#define Module_ComponentName "RISC_OSLib"
#define Module_ComponentPath "RiscOS/Sources/Lib/RISC_OSLib"
#define Module_FullVersion "5.45"
#define Module_HelpVersion "5.45 (17 Jan 2003)"
#define Module_LibraryVersionInfo "5:45"
#define Module_FullVersion "5.46"
#define Module_HelpVersion "5.46 (15 Apr 2003)"
#define Module_LibraryVersionInfo "5:46"
......@@ -40,6 +40,7 @@ extern int main(int argc, char **argv); /* the point of it all */
extern FILEHANDLE __dup(int new, int old);
extern void _ctype_init(void);
extern int _fprintf_lf(FILE *fp, const char *fmt, ...);
extern int _sprintf(char *buff, const char *fmt, ...);
extern int _sprintf_lf(char *buff, const char *fmt, ...);
extern _kernel_oserror *_kernel_peek_last_oserror(void);
......@@ -160,22 +161,25 @@ time_t time(time_t *timer)
*/
int _desktop_task()
{
int h = 0;
_kernel_swi_regs r;
if (_kernel_processor_mode() & 0xF) return 0;
_swix(TaskWindow_TaskInfo, _IN(0)|_OUT(0), 0, &h);
if (h) return 0;
_swix(Wimp_ReadSysInfo, _IN(0)|_OUT(0), 3, &h);
if (h == 0) return 0;
_swix(Wimp_ReadSysInfo, _IN(0)|_OUT(0), 5, &h);
return h;
r.r[0] = 0;
if (_kernel_swi(TaskWindow_TaskInfo, &r, &r) || r.r[0])
return 0;
r.r[0] = 3;
_kernel_swi(Wimp_ReadSysInfo, &r, &r);
if (r.r[0] == 0) return 0;
r.r[0] = 5;
_kernel_swi(Wimp_ReadSysInfo, &r, &r);
return r.r[0];
}
static int _desktop_report(const char *s, const char *but)
{
_kernel_swi_regs r;
_kernel_oserror err, *e;
const char *n = NULL;
char *p, *end;
int flags, r, h = _desktop_task();
int flags, h = _desktop_task();
if (h == 0) return 0;
flags = 0x102; /* New error, cancel button */
......@@ -210,17 +214,26 @@ static int _desktop_report(const char *s, const char *but)
e = &err;
}
_swix(TaskManager_TaskNameFromHandle, _IN(0)|_OUT(0), h, &n);
r = 0;
_swix(Wimp_ReportError, _INR(0,5)|_OUT(1), e, flags, n, NULL, 1, but, &r);
return r;
r.r[0] = h;
if (_kernel_swi(TaskManager_TaskNameFromHandle, &r, &r) == 0)
r.r[2] = r.r[0];
else
r.r[2] = 0;
r.r[0] = (int) e;
r.r[1] = flags;
r.r[3] = 0;
r.r[4] = 1;
r.r[5] = (int) but;
if (_kernel_swi(Wimp_ReportError, &r, &r) == 0)
return r.r[1];
else
return 0;
}
bool _sys__assert(const char *s, const char *expr, const char *file, int line)
bool _sys__assert(const char *s, const char *expr, const char *func, const char *file, int line)
{
char buffer[252];
int len, exprlen, filelen;
int len, funclen, exprlen, filelen;
if (!istty(stderr->__file)) return false;
......@@ -228,29 +241,39 @@ bool _sys__assert(const char *s, const char *expr, const char *file, int line)
if (strlen(s) > 200) return false; /* Be safe */
len = sprintf(buffer, s, "", "", line);
len = func ? _sprintf(buffer, s, "", "", "", line)
: _sprintf(buffer, s, "", "", line);
funclen = func ? strlen(func) : 0;
exprlen = strlen(expr);
filelen = strlen(file);
if (len + exprlen + filelen < 251)
if (len + funclen + exprlen + filelen < 251)
{
sprintf(buffer, s, expr, file, line);
func ? _sprintf(buffer, s, expr, func, file, line)
: _sprintf(buffer, s, expr, file, line);
}
else
{
char expr2[200];
char func2[50];
char file2[100];
#define min(a,b) a<b?a:b
exprlen = min(exprlen, 199);
funclen = min(funclen, 49);
filelen = min(filelen, 99);
filelen = min(filelen, 251-len-exprlen);
filelen = min(filelen, 251-len-funclen-exprlen);
if (filelen < 0) filelen = 0;
exprlen = min(exprlen, 251-len-filelen);
funclen = min(funclen, 251-len-exprlen-filelen);
if (funclen < 0) funclen = 0;
exprlen = min(exprlen, 251-len-funclen-filelen);
memcpy(expr2, expr, exprlen);
memcpy(func2, func, funclen);
memcpy(file2, file, filelen);
expr2[exprlen]='\0';
func2[funclen]='\0';
file2[filelen]='\0';
sprintf(buffer, s, expr2, file2, line);
func ? _sprintf(buffer, s, expr2, func2, file2, line)
: _sprintf(buffer, s, expr2, file2, line);
}
return _desktop_report(buffer, NULL);
}
......
......@@ -47,14 +47,27 @@ void _sysdie(const char *s)
}
/* from <assert.h> */
void __assert(char *expr, char *file, int line)
void __assert(const char *expr, const char *file, int line)
{
const char *s;
s = _kernel_getmessage("*** assertion failed: %s, file %s, line %d", "C34");
if (!_sys__assert(s, expr, file, line))
if (!_sys__assert(s, expr, NULL, file, line)) {
_fprintf_lf(stderr, s, expr, file, line);
fputc('\n', stderr);
fputc('\n', stderr);
}
abort();
}
void __assert2(const char *expr, const char *func, const char *file, int line)
{
const char *s;
s = _kernel_getmessage_def("*** assertion failed: %s, function %s, file %s, line %d", "C73");
if (!_sys__assert(s, expr, func, file, line)) {
_fprintf_lf(stderr, s, expr, func, file, line);
fputc('\n', stderr);
}
abort();
}
......
This diff is collapsed.
......@@ -94,10 +94,32 @@ typedef struct __extradata {
int __buflim; /* used size of buffer */
int __savedicnt; /* after unget contains old icnt */
int __savedocnt; /* after unget contains old ocnt */
#ifdef SUPPORT_WIDE
int __orientation;
mbstate_t __mbstate; /* must be stored in fpos_t */
#endif
} _extradata, *_extradatap;
static _extradatap _extra;
#ifdef SUPPORT_WIDE
#define O_NONE 0
#define O_BYTE (-1)
#define O_WIDE (+1)
#define ORIENTATION(stream) ((stream)->__extrap->__orientation)
#define BYTEORIENT(stream) (ORIENTATION(stream) == 0 ? \
ORIENTATION(stream) = O_BYTE : \
ORIENTATION(stream))
#define ENSUREBYTE(stream,e) do { if (BYTEORIENT(stream) != O_BYTE) return e; } while (0)
#define WIDEORIENT(stream) (ORIENTATION(stream) == 0 ? \
ORIENTATION(stream) = O_WIDE : \
ORIENTATION(stream))
#define ENSUREWIDE(stream,e) do { if (WIDEORIENT(stream) != O_WIDE) return e; } while (0)
#else
#define BYTEORIENT(stream)
#define ENSUREBYTE(stream,e)
#endif
#define EXTENT(stream) ((stream)->__extrap->__extent > (stream)->__ptr \
? (stream)->__extrap->__extent : (stream)->__ptr)
......@@ -222,6 +244,7 @@ int __backspace(FILE *stream)
int ungetc(int c,FILE *stream)
{ /* made into a fn to evaluate each arg once. */
ENSUREBYTE(stream, EOF);
if (c==EOF || (stream->__flag & (_IOUNGET+_IONOREADS))) return EOF;
/* put char into unget buffer */
stream->__extrap->__lilbuf[1] = c;
......@@ -808,6 +831,7 @@ size_t fread(void *ptr, size_t itemsize, size_t count, FILE *stream)
* is concerned and that the number of WHOLE items read is returned.
*/
dbmsg("fread %d\n", count);
ENSUREBYTE(stream, 0);
return itemsize == 0 ? 0 /* slight ansi irrationality */
: _read(ptr, itemsize*count, stream) / itemsize;
}
......@@ -917,6 +941,7 @@ size_t fwrite(const void *ptr, size_t itemsize, size_t count, FILE *stream)
/* The comments made about fread apply here too */
dbmsg_noNL("fwrite %d ", count);
dbmsg("itemsize %d (decimal)\n", itemsize);
ENSUREBYTE(fwrite, 0);
return itemsize == 0 ? count
: _write(ptr, itemsize*count, stream) / itemsize;
}
......
......@@ -154,23 +154,27 @@ void exit(int n)
_exit(n);
}
void _Exit(int n)
{
/* Is this the best way of doing this? abort() probably shouldn't be calling
* atexit functions either...
*/
while (exit_s.number_of_exit_functions!=0) {
int flags = _exitvector[exit_s.number_of_exit_functions].i;
if ((flags & 3) != 0) { ++exit_s.number_of_exit_functions; break; };
}
_exit(n);
}
void abort()
{
raise(SIGABRT);
exit(1);
}
int abs(int x)
{
if (x<0) return (-x);
else return x;
}
int (abs)(int x) { return abs(x); }
long int labs(long int x)
{
if (x<0) return (-x);
else return x;
}
long int (labs)(long int x) { return labs(x); }
#if 0
/* Compiler generates poo code at the minute - in machine code for now */
......
......@@ -349,15 +349,17 @@ size_t strxfrm(char *s1, const char *s2, size_t n)
int strcoll(const char *a, const char *b)
{
int ret;
_kernel_swi_regs r;
if (strcoll_territory == 0) return strcmp(a, b); /* C locale */
if (_swix(Territory_Collate, _INR(0,3)|_OUT(0),
strcoll_territory, a, b, 0,
&ret))
r.r[0] = strcoll_territory;
r.r[1] = (int) a;
r.r[2] = (int) b;
r.r[3] = 0;
if (_kernel_swi(Territory_Collate, &r, &r))
return 0;
return ret;
return r.r[0];
}
void _set_strcoll(int territory)
......
......@@ -74,3 +74,6 @@ C70:unknown error
#{DictTokens}
C71:Calling standard APCS-A no longer supported by C library
C72:Application is not 32-bit compatible
#{Default}
C73:*** assertion failed: %s, function %s, file %s, line %d
......@@ -14,19 +14,20 @@
*/
#pragma force_top_level
/* assert.h: ANSI 'C' (X3J11 Oct 88) library header, section 4.2 */
/* assert.h: ISO 'C' (9899:1999) library header, section 7.2 */
/* Copyright (C) Codemist Ltd. */
/* Copyright (C) Acorn Computers Ltd. 1991, 1992 */
/* version 2.00 */
/* version 2.01 */
/*
* The assert macro puts diagnostics into programs. When it is executed,
* if its argument expression is false, it writes information about the
* call that failed (including the text of the argument, the name of the
* source file, and the source line number - the latter are respectively
* the values of the preprocessing macros __FILE__ and __LINE__) on the
* source file, the source line number, and the name of the enclosing
* function - the latter are respectively the values of the preprocessing
* macros __FILE__ and __LINE__ and of the identifier __func__) on the
* standard error stream. It then calls the abort function.
* If its argument expression is true, the assert macro returns no value.
* The assert macro returns no value.
*/
/*
......@@ -38,9 +39,11 @@
#ifndef __assert_h
# define __assert_h
#ifdef __cplusplus
extern "C" void __assert(char *, char *, int);
extern "C" void __assert(const char *, const char *, int);
extern "C" void __assert2(const char *, const char *, const char *, int);
#else
extern void __assert(char *, char *, int);
extern void __assert(const char *, const char *, int);
extern void __assert2(const char *, const char *, const char *, int);
#endif
#else
# undef assert
......@@ -49,7 +52,13 @@
#ifdef NDEBUG
# define assert(ignore) ((void)0)
#else
# define assert(e) ((e) ? (void)0 : __assert(#e, __FILE__, __LINE__))
# define assert(e) ((e) ? (void)0 : __assert(#e, __FILE__, __LINE__))
# ifdef __STDC_VERSION__
# if __STDC_VERSION__ >= 199901
# undef assert
# define assert(e) ((e) ? (void)0 : __assert2(#e, __func__, __FILE__, __LINE__))
# endif
# endif
#endif
/* end of assert.h */
......@@ -15,7 +15,7 @@
#pragma force_top_level
#pragma include_only_once
/* ctype.h: ANSI 'C' (X3J11 Oct 88) library header, section 4.3 */
/* ctype.h: ISO 'C' (9899:1999) library header, section 7.4 */
/* Copyright (C) Codemist Ltd. */
/* Copyright (C) Acorn Computers Ltd. 1991, 1992 */
/* version 2.00 */
......@@ -89,27 +89,27 @@ extern unsigned char __ctype[];
/* non-0 iff c is a digit, in 'a'..'f', or in 'A'..'F' */
#ifndef __cplusplus
extern int (isalnum)(int c);
extern int (isalpha)(int c);
extern int (iscntrl)(int c);
extern int (isdigit)(int c);
extern int (isgraph)(int c);
extern int (islower)(int c);
extern int (isprint)(int c);
extern int (ispunct)(int c);
extern int (isspace)(int c);
extern int (isupper)(int c);
extern int (isxdigit)(int c);
int (isalnum)(int c);
int (isalpha)(int c);
int (iscntrl)(int c);
int (isdigit)(int c);
int (isgraph)(int c);
int (islower)(int c);
int (isprint)(int c);
int (ispunct)(int c);
int (isspace)(int c);
int (isupper)(int c);
int (isxdigit)(int c);
#endif
#ifdef __cplusplus
extern "C" {
#endif
extern int tolower(int c);
int tolower(int c);
/* if c is an upper-case letter then return the corresponding */
/* lower-case letter, otherwise return c. */
extern int toupper(int c);
int toupper(int c);
/* if c is an lower-case letter then return the corresponding */
/* upper-case letter, otherwise return c. */
#ifdef __cplusplus
......
......@@ -15,7 +15,7 @@
#pragma force_top_level
#pragma include_only_once
/* errno.h: ANSI 'C' (X3J11 Oct 88) library header, section 4.1.3 */
/* errno.h: ISO 'C' (9899:1999) library header, section 7.5 */
/* Copyright (C) Codemist Ltd. */
/* Copyright (C) Acorn Computers Ltd. 1991, 1992 */
/* version 2.00 */
......
......@@ -15,7 +15,7 @@
#pragma force_top_level
#pragma include_only_once
/* float.h: ISO 'C' (9899 Dec 99) library header, section 5.2.4.2 */
/* float.h: ISO 'C' (9899 Dec 99) library header, section 5.2.4.2.2 */
/* Copyright (C) Codemist Ltd, 1988 */
/* Copyright (C) Acorn Computers Ltd. 1991, 1992 */
/* version 3.00 */
......@@ -50,7 +50,7 @@
* range of the double type, evaluate long double operations and
* constants to the range and precision of the long double type;
* 2 : evaluate all operations and constants to the range and precision
* of the lang double type;
* of the long double type;
* ? : all other negative values are implementation defined.
*/
......@@ -84,6 +84,8 @@
#define DBL_MAX_EXP 1024
#define LDBL_MAX_EXP 1024
/* maximum integer such that FLT_RADIX raised to that power minus 1 is a */
/* representable finite floating-point number. */
#define FLT_MAX_10_EXP 38
#define DBL_MAX_10_EXP 308
#define LDBL_MAX_10_EXP 308
......
......@@ -200,21 +200,21 @@
typedef struct imaxdiv_t { intmax_t quot, rem; } imaxdiv_t;
/* type of the value returned by the imaxdiv function. */
extern intmax_t imaxabs(intmax_t /*j*/);
intmax_t imaxabs(intmax_t /*j*/);
/*
* computes the absolute value of an integer j. If the result cannot be
* represented, the behaviour is undefined.
* Returns: the absolute value.
*/
extern imaxdiv_t imaxdiv(intmax_t /*numer*/, intmax_t /*denom*/);
imaxdiv_t imaxdiv(intmax_t /*numer*/, intmax_t /*denom*/);
/*
* computes numer / denom and numer % denom in a single operation.
* Returns: a structure of type imaxdiv_t, comprising both the quotient and
* the remainder.
*/
extern intmax_t strtoimax(const char * restrict /*nptr*/,
char ** restrict /*endptr*/, int /*base*/);
intmax_t strtoimax(const char * restrict /*nptr*/,
char ** restrict /*endptr*/, int /*base*/);
/*
* equivalent to the strtoll function, except that the initial portion of the
* string is converted to intmax_t representation.
......@@ -224,8 +224,8 @@ extern intmax_t strtoimax(const char * restrict /*nptr*/,
* (according to the sign of the value), and the value of the
* macro ERANGE is stored in errno.
*/
extern uintmax_t strtoumax(const char * restrict /*nptr*/,
char ** restrict /*endptr*/, int /*base*/);
uintmax_t strtoumax(const char * restrict /*nptr*/,
char ** restrict /*endptr*/, int /*base*/);
/*
* equivalent to the strtoull function, except that the initial portion of
* the string is converted to uintmax_t representation.
......
......@@ -15,7 +15,7 @@
#pragma force_top_level
#pragma include_only_once
/* locale.h: ANSI 'C' (X3J11 Oct 88) library header, section 4.3 */
/* locale.h: ISO 'C' (9899:1999) library header, section 7.11 */
/* Copyright (C) Codemist Ltd. */
/* Copyright (C) Acorn Computers Ltd. 1991, 1992 */
/* version 2.00 */
......
This diff is collapsed.
......@@ -15,7 +15,7 @@
#pragma force_top_level
#pragma include_only_once
/* setjmp.h: ANSI 'C' (X3J11 Oct 88) library header, section 4.6 */
/* setjmp.h: ISO 'C' (9899:1999) library header, section 7.13 */
/* Copyright (C) A.C. Norman and A. Mycroft */
/* Copyright (C) Acorn Computers Ltd. 1991, 1992 */
/* version 2.00 */
......@@ -49,7 +49,7 @@ typedef int jmp_buf[22]; /* size suitable for the ARM */
#ifdef __cplusplus
extern "C" {
#endif
extern int setjmp(jmp_buf /*env*/);
int setjmp(jmp_buf /*env*/);
/* Saves its calling environment in its jmp_buf argument, for later use
* by the longjmp function.
* Returns: If the return is from a direct invocation, the setjmp function
......@@ -57,7 +57,7 @@ extern int setjmp(jmp_buf /*env*/);
* function, the setjmp function returns a non zero value.
*/
extern void longjmp(jmp_buf /*env*/, int /*val*/);
void longjmp(jmp_buf /*env*/, int /*val*/);
/* Restores the environment saved by the most recent call to setjmp in the
* same invocation of the program, with the corresponding jmp_buf argument.
* If there has been no such call, or if the function containing the call
......
......@@ -15,7 +15,7 @@
#pragma force_top_level
#pragma include_only_once
/* signal.h: ANSI 'C' (X3J11 Oct 88) library header, section 4.7 */
/* signal.h: ISO 'C' (9899:1999) library header, section 7.14 */
/* Copyright (C) Codemist Ltd. */
/* Copyright (C) Acorn Computers Ltd. 1991, 1992 */
/* version 2.00 */
......@@ -36,9 +36,9 @@ typedef int sig_atomic_t;
#ifdef __cplusplus
extern "C" {
#endif
extern void __SIG_DFL(int);
extern void __SIG_ERR(int);