build: Improve --with-system-libc support.
* build-aux/build-lib.sh: Avoid building libc for --with-system-libc. Make libmes richer. build-aux/check-mescc.sh: Enable 50-malloc test. * include/dirstream.h: Use HAVE_DIRSTREAM_H to cater for non-existing dirstream.h. * include/grp.h[SYSTEM_LIBC]: Typo. * include/mes/lib.h (__brk, __call_at_exit)[SYSTEM_LIBC]: Declare. * include/stdlib.h (comparison_fn_t)[SYSTEM_LIBC]: Declare. * include/time.h (mktime): Return time_t. * lib/posix/isatty.c [SYSTEM_LIBC]: Do not (re)declare termios. * lib/stub/mktime.c (mktime): Return time_t. * lib/tests/scaffold/41-ternary.c (main): Remove assumption that locals are initialized. * lib/tests/scaffold/70-stdarg.c: Cater for SYSTEM_LIBC. * lib/tests/setjmp/80-setjmp.c: Declare jmp buf. * lib/*/*.c: Add missing mes/lib.h, errno.h includes.
This commit is contained in:
parent
9f60920538
commit
dd0a0d779a
|
@ -52,6 +52,8 @@ fi
|
||||||
|
|
||||||
libmes_SOURCES="
|
libmes_SOURCES="
|
||||||
$libc_mini_SOURCES
|
$libc_mini_SOURCES
|
||||||
|
lib/ctype/isnumber.c
|
||||||
|
lib/mes/abtol.c
|
||||||
lib/mes/itoa.c
|
lib/mes/itoa.c
|
||||||
lib/mes/ltoa.c
|
lib/mes/ltoa.c
|
||||||
lib/mes/ltoab.c
|
lib/mes/ltoab.c
|
||||||
|
@ -70,12 +72,13 @@ lib/mes/oputc.c
|
||||||
if test $mes_libc = mes; then
|
if test $mes_libc = mes; then
|
||||||
libmes_SOURCES="$libmes_SOURCES
|
libmes_SOURCES="$libmes_SOURCES
|
||||||
lib/stdlib/atoi.c
|
lib/stdlib/atoi.c
|
||||||
lib/mes/abtol.c
|
|
||||||
lib/ctype/isdigit.c
|
lib/ctype/isdigit.c
|
||||||
lib/ctype/isnumber.c
|
|
||||||
lib/ctype/isspace.c
|
lib/ctype/isspace.c
|
||||||
lib/ctype/isxdigit.c
|
lib/ctype/isxdigit.c
|
||||||
"
|
"
|
||||||
|
else
|
||||||
|
libmes_SOURCES="$libmes_SOURCES
|
||||||
|
"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
libc_SOURCES="
|
libc_SOURCES="
|
||||||
|
@ -184,55 +187,7 @@ lib/stub/ldexp.c
|
||||||
lib/stub/mprotect.c
|
lib/stub/mprotect.c
|
||||||
lib/stub/localtime.c
|
lib/stub/localtime.c
|
||||||
lib/stub/sigemptyset.c
|
lib/stub/sigemptyset.c
|
||||||
lib/ctype/islower.c
|
lib/stub/strtod.c
|
||||||
lib/ctype/isupper.c
|
|
||||||
lib/ctype/tolower.c
|
|
||||||
lib/ctype/toupper.c
|
|
||||||
lib/mes/search-path.c
|
|
||||||
lib/posix/execvp.c
|
|
||||||
lib/stdio/fclose.c
|
|
||||||
lib/stdio/fdopen.c
|
|
||||||
lib/stdio/ferror.c
|
|
||||||
lib/stdio/fflush.c
|
|
||||||
lib/stdio/fopen.c
|
|
||||||
lib/stdio/fprintf.c
|
|
||||||
lib/stdio/fread.c
|
|
||||||
lib/stdio/fseek.c
|
|
||||||
lib/stdio/ftell.c
|
|
||||||
lib/stdio/fwrite.c
|
|
||||||
lib/stdio/printf.c
|
|
||||||
lib/stdio/remove.c
|
|
||||||
lib/stdio/snprintf.c
|
|
||||||
lib/stdio/sprintf.c
|
|
||||||
lib/stdio/sscanf.c
|
|
||||||
lib/stdio/vfprintf.c
|
|
||||||
lib/stdio/vprintf.c
|
|
||||||
lib/stdio/vsnprintf.c
|
|
||||||
lib/stdio/vsprintf.c
|
|
||||||
lib/stdio/vsscanf.c
|
|
||||||
lib/stdlib/calloc.c
|
|
||||||
lib/stdlib/qsort.c
|
|
||||||
lib/stdlib/strtof.c
|
|
||||||
lib/stdlib/strtol.c
|
|
||||||
lib/stdlib/strtold.c
|
|
||||||
lib/stdlib/strtoll.c
|
|
||||||
lib/stdlib/strtoul.c
|
|
||||||
lib/stdlib/strtoull.c
|
|
||||||
lib/string/memmem.c
|
|
||||||
lib/string/memmove.c
|
|
||||||
lib/string/strcat.c
|
|
||||||
lib/string/strchr.c
|
|
||||||
lib/string/strlwr.c
|
|
||||||
lib/string/strncpy.c
|
|
||||||
lib/string/strrchr.c
|
|
||||||
lib/string/strstr.c
|
|
||||||
lib/string/strupr.c
|
|
||||||
lib/stub/sigaction.c
|
|
||||||
lib/stub/ldexp.c
|
|
||||||
lib/stub/mprotect.c
|
|
||||||
lib/stub/localtime.c
|
|
||||||
lib/stub/sigemptyset.c
|
|
||||||
xslib/stub/strtod.c
|
|
||||||
lib/$mes_cpu-mes-$compiler/setjmp.c
|
lib/$mes_cpu-mes-$compiler/setjmp.c
|
||||||
"
|
"
|
||||||
|
|
||||||
|
@ -367,10 +322,12 @@ if test -e libmes.s; then
|
||||||
cp libmes.s $mes_cpu-mes
|
cp libmes.s $mes_cpu-mes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
archive libc.a $libc_SOURCES
|
if test $mes_libc = mes; then
|
||||||
cp libc.a $mes_cpu-mes
|
archive libc.a $libc_SOURCES
|
||||||
if test -e libc.s; then
|
cp libc.a $mes_cpu-mes
|
||||||
cp libc.S $mes_cpu-mes
|
if test -e libc.s; then
|
||||||
|
cp libc.s $mes_cpu-mes
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
archive libc+tcc.a $libc_tcc_SOURCES
|
archive libc+tcc.a $libc_tcc_SOURCES
|
||||||
|
|
|
@ -101,6 +101,7 @@ lib/tests/scaffold/48-global-static.c
|
||||||
lib/tests/assert/50-assert.c
|
lib/tests/assert/50-assert.c
|
||||||
lib/tests/mes/50-itoa.c
|
lib/tests/mes/50-itoa.c
|
||||||
lib/tests/posix/50-getenv.c
|
lib/tests/posix/50-getenv.c
|
||||||
|
lib/tests/stdlib/50-malloc.c
|
||||||
lib/tests/string/50-strcmp.c
|
lib/tests/string/50-strcmp.c
|
||||||
lib/tests/string/50-strcpy.c
|
lib/tests/string/50-strcpy.c
|
||||||
lib/tests/string/50-strncmp.c
|
lib/tests/string/50-strncmp.c
|
||||||
|
|
|
@ -50,7 +50,7 @@ fi
|
||||||
|
|
||||||
if test $mes_libc = system; then
|
if test $mes_libc = system; then
|
||||||
crt1=
|
crt1=
|
||||||
LIBS=-lmes
|
LIBS='-l mes'
|
||||||
else
|
else
|
||||||
crt1=crt1.o
|
crt1=crt1.o
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#ifndef __MES_DIRSTREAM_H
|
#ifndef __MES_DIRSTREAM_H
|
||||||
#define __MES_DIRSTREAM_H 1
|
#define __MES_DIRSTREAM_H 1
|
||||||
|
|
||||||
#if SYSTEM_LIBC
|
#if SYSTEM_LIBC && HAVE_DIRSTREAM_H
|
||||||
#ifndef _GNU_SOURCE
|
#ifndef _GNU_SOURCE
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#if SYSTEM_LIBC
|
#if SYSTEM_LIBC
|
||||||
#undef __MES_GRP_H
|
#undef __MES_GRP_H
|
||||||
#include_next <pwd.h>
|
#include_next <grp.h>
|
||||||
#else // ! SYSTEM_LIBC
|
#else // ! SYSTEM_LIBC
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
|
@ -41,6 +41,7 @@ char * fdgets (char *s, int count, int fd);
|
||||||
int fdputc (int c, int fd);
|
int fdputc (int c, int fd);
|
||||||
int fdputs (char const *s, int fd);
|
int fdputs (char const *s, int fd);
|
||||||
int fdungetc (int c, int fd);
|
int fdungetc (int c, int fd);
|
||||||
|
int isnumber (int c, int base);
|
||||||
int mes_open (char const *file_name, int flags, int mask);
|
int mes_open (char const *file_name, int flags, int mask);
|
||||||
int _open2 (char const *file_name, int flags);
|
int _open2 (char const *file_name, int flags);
|
||||||
int _open3 (char const *file_name, int flags, int mask);
|
int _open3 (char const *file_name, int flags, int mask);
|
||||||
|
@ -48,10 +49,10 @@ int oputc (int c);
|
||||||
int oputs (char const *s);
|
int oputs (char const *s);
|
||||||
char *search_path (char const *file_name);
|
char *search_path (char const *file_name);
|
||||||
|
|
||||||
#if !SYSTEM_LIBC
|
|
||||||
|
|
||||||
extern char *__brk;
|
extern char *__brk;
|
||||||
extern void (*__call_at_exit) (void);
|
extern void (*__call_at_exit) (void);
|
||||||
|
|
||||||
|
#if !SYSTEM_LIBC
|
||||||
void __assert_fail (char *s);
|
void __assert_fail (char *s);
|
||||||
void _exit (int code);
|
void _exit (int code);
|
||||||
long brk (void *addr);
|
long brk (void *addr);
|
||||||
|
|
|
@ -20,6 +20,11 @@
|
||||||
#ifndef __MES_STDLIB_H
|
#ifndef __MES_STDLIB_H
|
||||||
#define __MES_STDLIB_H 1
|
#define __MES_STDLIB_H 1
|
||||||
|
|
||||||
|
#ifndef __MES_COMPARISON_FN_T
|
||||||
|
#define __MES_COMPARISON_FN_T
|
||||||
|
typedef int (*comparison_fn_t) (void const *, void const *);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if SYSTEM_LIBC
|
#if SYSTEM_LIBC
|
||||||
#ifndef _GNU_SOURCE
|
#ifndef _GNU_SOURCE
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
@ -56,11 +61,6 @@ unsigned long long strtoull (char const *string, char **tailptr, int base);
|
||||||
#define EXIT_FAILURE 1
|
#define EXIT_FAILURE 1
|
||||||
#define EXIT_SUCCESS 0
|
#define EXIT_SUCCESS 0
|
||||||
|
|
||||||
#ifndef __MES_COMPARISON_FN_T
|
|
||||||
#define __MES_COMPARISON_FN_T
|
|
||||||
typedef int (*comparison_fn_t) (void const *, void const *);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void *bsearch (void const *key, void const *array, size_t count, size_t size, comparison_fn_t compare);
|
void *bsearch (void const *key, void const *array, size_t count, size_t size, comparison_fn_t compare);
|
||||||
|
|
||||||
#endif // ! SYSTEM_LIBC
|
#endif // ! SYSTEM_LIBC
|
||||||
|
|
|
@ -59,6 +59,7 @@ struct timespec
|
||||||
int clock_gettime (clockid_t clk_id, struct timespec *tp);
|
int clock_gettime (clockid_t clk_id, struct timespec *tp);
|
||||||
struct tm *localtime (time_t const *timep);
|
struct tm *localtime (time_t const *timep);
|
||||||
struct tm *gmtime (time_t const *time);
|
struct tm *gmtime (time_t const *time);
|
||||||
|
int nanosleep (struct timespec const *requested_time, struct timespec const *remaining);
|
||||||
time_t time (time_t * tloc);
|
time_t time (time_t * tloc);
|
||||||
|
|
||||||
#endif // ! SYSTEM_LIBC
|
#endif // ! SYSTEM_LIBC
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
// Taken from GNU C Library 1.06.4
|
// Taken from GNU C Library 1.06.4
|
||||||
|
|
||||||
|
#include <mes/lib.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
// Taken from GNU C Library 2.2.5
|
// Taken from GNU C Library 2.2.5
|
||||||
|
|
||||||
|
#include <mes/lib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <termio.h>
|
#include <termio.h>
|
||||||
|
|
||||||
|
#if !SYSTEM_LIBC
|
||||||
typedef unsigned char cc_t;
|
typedef unsigned char cc_t;
|
||||||
typedef unsigned int speed_t;
|
typedef unsigned int speed_t;
|
||||||
typedef unsigned int tcflag_t;
|
typedef unsigned int tcflag_t;
|
||||||
|
@ -39,6 +40,7 @@ struct termios
|
||||||
cc_t c_line;
|
cc_t c_line;
|
||||||
cc_t c_cc[NCCS];
|
cc_t c_cc[NCCS];
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
struct ktermios
|
struct ktermios
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <mes/lib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <mes/lib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <mes/lib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@ -26,7 +27,7 @@ printf (char const *format, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int r;
|
int r;
|
||||||
#if __GNUC__ && __x86_64__
|
#if __GNUC__ && __x86_64__ && !SYSTEM_LIBC
|
||||||
#define __FUNCTION_ARGS 1
|
#define __FUNCTION_ARGS 1
|
||||||
ap += (__FOO_VARARGS + (__FUNCTION_ARGS << 1)) << 3;
|
ap += (__FOO_VARARGS + (__FUNCTION_ARGS << 1)) << 3;
|
||||||
#undef __FUNCTION_ARGS
|
#undef __FUNCTION_ARGS
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <mes/lib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@ -26,7 +27,7 @@ snprintf (char *str, size_t size, char const *format, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int r;
|
int r;
|
||||||
#if __GNUC__ && __x86_64__
|
#if __GNUC__ && __x86_64__ && !SYSTEM_LIBC
|
||||||
#define __FUNCTION_ARGS 3
|
#define __FUNCTION_ARGS 3
|
||||||
ap += (__FOO_VARARGS + (__FUNCTION_ARGS << 1)) << 3;
|
ap += (__FOO_VARARGS + (__FUNCTION_ARGS << 1)) << 3;
|
||||||
#undef __FUNCTION_ARGS
|
#undef __FUNCTION_ARGS
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <mes/lib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@ -26,7 +27,7 @@ sprintf (char *str, char const *format, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
int r;
|
int r;
|
||||||
#if __GNUC__ && __x86_64__
|
#if __GNUC__ && __x86_64__ && !SYSTEM_LIBC
|
||||||
#define __FUNCTION_ARGS 2
|
#define __FUNCTION_ARGS 2
|
||||||
ap += (__FOO_VARARGS + (__FUNCTION_ARGS << 1)) << 3;
|
ap += (__FOO_VARARGS + (__FUNCTION_ARGS << 1)) << 3;
|
||||||
#undef __FUNCTION_ARGS
|
#undef __FUNCTION_ARGS
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <mes/lib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <mes/lib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
struct passwd *
|
struct passwd *
|
||||||
|
|
|
@ -19,10 +19,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
struct passwd *
|
struct passwd *
|
||||||
getpwuid ()
|
getpwuid (uid_t uid)
|
||||||
{
|
{
|
||||||
static int stub = 0;
|
static int stub = 0;
|
||||||
if (__mes_debug () && !stub)
|
if (__mes_debug () && !stub)
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
pclose (int x)
|
pclose (int x)
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
popen (int x)
|
popen (int x)
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
#include <pwd.h>
|
#include <errno.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
rand (void)
|
rand (void)
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
rewind (int x)
|
rewind (int x)
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
setbuf (int x)
|
setbuf (int x)
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
sigsetmask (int x)
|
sigsetmask (int x)
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
sys_siglist (int x)
|
sys_siglist (int x)
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
system (int x)
|
system (int x)
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
umask (int x)
|
umask (int x)
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <mes/lib.h>
|
#include <mes/lib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
utime (int x)
|
utime (int x)
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <mes/lib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* -*-comment-start: "//";comment-end:""-*-
|
/* -*-comment-start: "//";comment-end:""-*-
|
||||||
* GNU Mes --- Maxwell Equations of Software
|
* GNU Mes --- Maxwell Equations of Software
|
||||||
* Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
* Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||||
*
|
*
|
||||||
* This file is part of GNU Mes.
|
* This file is part of GNU Mes.
|
||||||
*
|
*
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
int
|
int
|
||||||
main ()
|
main ()
|
||||||
{
|
{
|
||||||
int f;
|
int f = 0;
|
||||||
int t = 1;
|
int t = 1;
|
||||||
int one = t;
|
int one = t;
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ stdarg1 (long *one, ...)
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
va_start (ap, one);
|
va_start (ap, one);
|
||||||
#if __GNUC__ && __x86_64__
|
#if __GNUC__ && __x86_64__ && !SYSTEM_LIBC
|
||||||
#define __FUNCTION_ARGS 1
|
#define __FUNCTION_ARGS 1
|
||||||
ap += (__FOO_VARARGS + (__FUNCTION_ARGS << 1)) << 3;
|
ap += (__FOO_VARARGS + (__FUNCTION_ARGS << 1)) << 3;
|
||||||
#undef __FUNCTION_ARGS
|
#undef __FUNCTION_ARGS
|
||||||
|
@ -54,7 +54,7 @@ stdarg2 (long *one, long *two, ...)
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
va_start (ap, two);
|
va_start (ap, two);
|
||||||
#if __GNUC__ && __x86_64__
|
#if __GNUC__ && __x86_64__ && !SYSTEM_LIBC
|
||||||
#define __FUNCTION_ARGS 2
|
#define __FUNCTION_ARGS 2
|
||||||
ap += (__FOO_VARARGS + (__FUNCTION_ARGS << 1)) << 3;
|
ap += (__FOO_VARARGS + (__FUNCTION_ARGS << 1)) << 3;
|
||||||
#undef __FUNCTION_ARGS
|
#undef __FUNCTION_ARGS
|
||||||
|
@ -78,7 +78,7 @@ stdarg3 (long *one, long *two, long *three, ...)
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
va_start (ap, three);
|
va_start (ap, three);
|
||||||
#if __GNUC__ && __x86_64__
|
#if __GNUC__ && __x86_64__ && !SYSTEM_LIBC
|
||||||
#define __FUNCTION_ARGS 3
|
#define __FUNCTION_ARGS 3
|
||||||
ap += (__FOO_VARARGS + (__FUNCTION_ARGS << 1)) << 3;
|
ap += (__FOO_VARARGS + (__FUNCTION_ARGS << 1)) << 3;
|
||||||
#undef __FUNCTION_ARGS
|
#undef __FUNCTION_ARGS
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
|
|
||||||
int foo;
|
int foo;
|
||||||
|
jmp_buf buf;
|
||||||
|
|
||||||
void
|
void
|
||||||
second ()
|
second ()
|
||||||
|
|
Loading…
Reference in a new issue