NEXT __M2__
This commit is contained in:
parent
d6cf3b4e90
commit
9be7cceddf
|
@ -29,9 +29,12 @@
|
|||
|
||||
#define _SIGSET_NITEMS (_NSIG / (8 * sizeof(unsigned long)))
|
||||
|
||||
typedef struct {
|
||||
#if !__M2__
|
||||
typedef struct
|
||||
{
|
||||
unsigned long items[_SIGSET_NITEMS];
|
||||
} sigset_t;
|
||||
#endif
|
||||
typedef long stack_t;
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -91,6 +94,7 @@ typedef long stack_t;
|
|||
#define SA_NOMASK SA_NODEFER
|
||||
#define SA_ONESHOT SA_RESETHAND
|
||||
|
||||
#if !__M2__ // lacks short, casts
|
||||
typedef struct siginfo_t
|
||||
{
|
||||
int si_signo;
|
||||
|
@ -120,7 +124,7 @@ typedef struct siginfo_t
|
|||
} siginfo_t;
|
||||
// *INDENT-ON*
|
||||
|
||||
#if __MESC__
|
||||
#if __M2__ || __MESC__
|
||||
typedef long sighandler_t;
|
||||
#else
|
||||
typedef void (*sighandler_t) (int);
|
||||
|
@ -255,6 +259,7 @@ int sigemptyset (sigset_t * set);
|
|||
#endif
|
||||
int sigprocmask (int how, sigset_t const *set, sigset_t * oldset);
|
||||
|
||||
#endif // !__M2__
|
||||
#endif //! SYSTEM_LIBC
|
||||
|
||||
#endif // __MES_SIGNAL_H
|
||||
|
|
|
@ -28,8 +28,13 @@
|
|||
|
||||
#define TCGETS 0x5401
|
||||
#define TCGETA 0x5405
|
||||
#if __M2__
|
||||
int ioctl (int fd, unsigned request, long data);
|
||||
int ioctl3 (int fd, unsigned request, long data);
|
||||
#else
|
||||
int ioctl (int fd, unsigned long request, ...);
|
||||
int ioctl3 (int fd, unsigned long request, long data);
|
||||
#endif
|
||||
|
||||
#endif // ! SYSTEM_LIBC
|
||||
|
||||
|
|
|
@ -36,7 +36,29 @@ typedef int mode_t;
|
|||
#endif
|
||||
|
||||
// *INDENT-OFF*
|
||||
#if __i386__ || __arm__
|
||||
#if __M2__
|
||||
struct stat
|
||||
{
|
||||
unsigned st_dev;
|
||||
unsigned st_ino;
|
||||
char st_mode[2];
|
||||
char st_nlink[2];
|
||||
char st_uid[2];
|
||||
char st_gid[2];
|
||||
unsigned st_rdev;
|
||||
long st_size; /* Linux: unsigned long; glibc: off_t (i.e. signed) */
|
||||
unsigned st_blksize;
|
||||
unsigned st_blocks;
|
||||
time_t st_atime; /* Linux: unsigned long; glibc: time_t */
|
||||
unsigned st_atime_usec;
|
||||
time_t st_mtime; /* Linux: unsigned long; glibc: time_t */
|
||||
unsigned st_mtime_usec;
|
||||
time_t st_ctime; /* Linux: unsigned long; glibc: time_t */
|
||||
unsigned st_ctime_usec;
|
||||
unsigned __foo0;
|
||||
unsigned __foo1;
|
||||
};
|
||||
#elif __i386__ || __arm__
|
||||
struct stat
|
||||
{
|
||||
unsigned long st_dev;
|
||||
|
|
|
@ -32,7 +32,12 @@
|
|||
#endif
|
||||
|
||||
#ifndef EOF
|
||||
#define EOF -1
|
||||
// FIXME M2_Planet chokes on -1, even inside #if ! __M2__
|
||||
#if __arm__ || __i386__
|
||||
#define EOF 0xffffffff
|
||||
#else
|
||||
#define EOF 0xffffffffffffffff
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
|
@ -142,9 +147,13 @@ typedef long sigval_t;
|
|||
#ifndef __MES_SIZE_T
|
||||
#define __MES_SIZE_T
|
||||
#undef size_t
|
||||
#if __M2__
|
||||
typedef unsigned size_t;
|
||||
#else
|
||||
typedef unsigned long size_t;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __MES_SSIZE_T
|
||||
#define __MES_SSIZE_T
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2017,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -27,8 +27,8 @@
|
|||
|
||||
#ifndef __MES_TIME_T
|
||||
#define __MES_TIME_T 1
|
||||
typedef long int clockid_t;
|
||||
typedef long int time_t;
|
||||
typedef long clockid_t;
|
||||
typedef long time_t;
|
||||
#endif
|
||||
|
||||
struct tm
|
||||
|
|
17
src/gc.c
17
src/gc.c
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2016,2017,2018,2019,2020,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2016,2017,2018,2019,2020,2021,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2022 Gabriel Wicki <gabriel@erlikon.ch>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
|
@ -31,8 +31,11 @@
|
|||
|
||||
int g_dump_filedes;
|
||||
|
||||
#if __M2__
|
||||
#define M2_CELL_SIZE 12
|
||||
#else
|
||||
#define M2_CELL_SIZE 1U
|
||||
// CONSTANT M2_CELL_SIZE 12
|
||||
#endif
|
||||
|
||||
char *
|
||||
cell_bytes (struct scm *x)
|
||||
|
@ -41,16 +44,20 @@ cell_bytes (struct scm *x)
|
|||
return p + (2 * sizeof (long));
|
||||
}
|
||||
|
||||
#if __M2__
|
||||
#define U10 10
|
||||
#define U100 100
|
||||
#else
|
||||
#define U10 10U
|
||||
// CONSTANT U10 10
|
||||
#define U100 100U
|
||||
// CONSTANT U100 100
|
||||
#endif
|
||||
|
||||
void
|
||||
gc_init ()
|
||||
{
|
||||
#if SYSTEM_LIBC
|
||||
ARENA_SIZE = 100000000; /* 2.3GiB */
|
||||
#elif ! __M2_PLANET__
|
||||
#elif ! __M2__
|
||||
ARENA_SIZE = 300000; /* 32b: 3MiB, 64b: 6 MiB */
|
||||
#else
|
||||
ARENA_SIZE = 20000000;
|
||||
|
|
15
src/posix.c
15
src/posix.c
|
@ -35,7 +35,7 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#if SYSTEM_LIBC
|
||||
#define __raise(x) -1
|
||||
//#define __raise(x) -1
|
||||
#endif
|
||||
|
||||
struct scm *
|
||||
|
@ -377,13 +377,14 @@ waitpid_ (struct scm *pid, struct scm *options)
|
|||
return cons (make_number (child), make_number (status));
|
||||
}
|
||||
|
||||
#if __x86_64__
|
||||
#if __M2__
|
||||
/* Milliseconds for everyone else. */
|
||||
#define TIME_UNITS_PER_SECOND 1000
|
||||
#elif __x86_64__
|
||||
/* Nanoseconds on 64-bit systems with POSIX timers. */
|
||||
// CONSTANT TIME_UNITS_PER_SECOND 1000000000
|
||||
#define TIME_UNITS_PER_SECOND 1000000000U
|
||||
#else
|
||||
/* Milliseconds for everyone else. */
|
||||
// CONSTANT TIME_UNITS_PER_SECOND 1000
|
||||
#define TIME_UNITS_PER_SECOND 1000U
|
||||
#endif
|
||||
|
||||
|
@ -408,8 +409,12 @@ gettimeofday_ () /*:((name . "gettimeofday")) */
|
|||
return cons (make_number (time->tv_sec), make_number (time->tv_usec));
|
||||
}
|
||||
|
||||
#if __M2__
|
||||
#define UL1000000000 1000000000
|
||||
#else
|
||||
#define UL1000000000 1000000000UL
|
||||
// CONSTANT UL1000000000 1000000000
|
||||
#endif
|
||||
|
||||
long
|
||||
seconds_and_nanoseconds_to_long (long s, long ns)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue