core: Move M2_PTR_SIZE, M2_CELL_SIZE to include file.
* lib/posix/getenv.c (M2_PTR_SIZE), lib/posix/setenv.c (M2_PTR_SIZE): Move definition... * include/mes/lib-mini.h (M2_PTR_SIZE): ...here. * src/gc.c (M2_CELL_SIZE), src/symbol.c (M2_CELL_SIZE), src/test/gc.c (M2_CELL_SIZE), src/vector.c (M2_CELL_SIZE): Move definition... * include/mes/mes.h (M2_CELL_SIZE): ...here.
This commit is contained in:
parent
7725574935
commit
cbea14f843
|
@ -37,6 +37,15 @@
|
|||
#define STDERR 2
|
||||
#endif
|
||||
|
||||
/* M2-Planet does not support pointer arithmetic. Explicitly compensate
|
||||
for that by multiplying with M2_PTR_SIZE when using (char)
|
||||
pointers. */
|
||||
#if __M2__
|
||||
#define M2_PTR_SIZE 4
|
||||
#else
|
||||
#define M2_PTR_SIZE 1
|
||||
#endif
|
||||
|
||||
extern char **environ;
|
||||
extern int __stdin;
|
||||
extern int __stdout;
|
||||
|
|
|
@ -53,6 +53,15 @@ struct scm
|
|||
};
|
||||
};
|
||||
|
||||
/* M2-Planet does not support pointer arithmetic. Explicitly compensate
|
||||
for that by multiplying with M2_CELL_SIZE when using cell
|
||||
pointers. */
|
||||
#if __M2__
|
||||
#define M2_CELL_SIZE 12
|
||||
#else
|
||||
#define M2_CELL_SIZE 1
|
||||
#endif
|
||||
|
||||
/* mes */
|
||||
extern char *g_datadir;
|
||||
extern int g_debug;
|
||||
|
|
|
@ -22,12 +22,6 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if __M2__
|
||||
#define M2_PTR_SIZE 4
|
||||
#else
|
||||
#define M2_PTR_SIZE 1
|
||||
#endif
|
||||
|
||||
char *
|
||||
getenv (char const *s)
|
||||
{
|
||||
|
|
|
@ -22,12 +22,6 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if __M2__
|
||||
#define M2_PTR_SIZE 4
|
||||
#else
|
||||
#define M2_PTR_SIZE 1
|
||||
#endif
|
||||
|
||||
int
|
||||
setenv (char const *s, char const *v, int overwrite_p)
|
||||
{
|
||||
|
|
6
src/gc.c
6
src/gc.c
|
@ -31,12 +31,6 @@
|
|||
|
||||
int g_dump_filedes;
|
||||
|
||||
#if __M2__
|
||||
#define M2_CELL_SIZE 12
|
||||
#else
|
||||
#define M2_CELL_SIZE 1U
|
||||
#endif
|
||||
|
||||
char *
|
||||
cell_bytes (struct scm *x)
|
||||
{
|
||||
|
|
|
@ -23,12 +23,6 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#if __M2__
|
||||
#define M2_CELL_SIZE 12
|
||||
#else
|
||||
#define M2_CELL_SIZE 1
|
||||
#endif
|
||||
|
||||
struct scm *
|
||||
init_symbol (struct scm *x, long type, char const *name)
|
||||
{
|
||||
|
|
|
@ -24,12 +24,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if __M2__
|
||||
#define M2_CELL_SIZE 12
|
||||
#else
|
||||
#define M2_CELL_SIZE 1
|
||||
#endif
|
||||
|
||||
int g_debug;
|
||||
|
||||
void
|
||||
|
|
|
@ -21,12 +21,6 @@
|
|||
#include "mes/lib.h"
|
||||
#include "mes/mes.h"
|
||||
|
||||
#if __M2__
|
||||
#define M2_CELL_SIZE 12
|
||||
#else
|
||||
#define M2_CELL_SIZE 1
|
||||
#endif
|
||||
|
||||
struct scm *
|
||||
make_vector_ (long k, struct scm *e)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue