bunch of header file changes

This commit is contained in:
dzaima 2022-01-06 01:17:10 +02:00
parent 9dc3ef1eb8
commit ade183e635
12 changed files with 30 additions and 25 deletions

View File

@ -38,7 +38,6 @@ enum PrimNumbers {
/* ´˝`∘○⊸⟜⌾⊘◶ */ n_fold , n_insert , n_scan , n_atop , n_over , n_before , n_after , n_under, n_val , n_cond,
/* ⎉⚇⍟⎊ */ n_rank , n_depth , n_repeat, n_catch
};
extern B rt_invFnReg, rt_invFnSwap;
extern BB2B rt_invFnRegFn;
extern BB2B rt_invFnSwapFn;
@ -75,9 +74,10 @@ static inline bool isImpureBuiltin(B x) {
return false;
}
#define F(N,X) extern B bi_##N;
extern B
#define F(N,X) bi_##N,
FOR_PFN(F,F,F)
FOR_PM1(F,F,F)
FOR_PM2(F,F,F)
#undef F
rt_invFnReg, rt_invFnSwap;

View File

@ -1,6 +1,6 @@
#define C8Atom u8
#define C16Atom u16
#define C32Atom u32
#define c8 u8
#define c16 u16
#define c32 u32
#define TU C8
#define TP(W,X) W##c8##X
@ -11,9 +11,10 @@
#define TU C32
#define TP(W,X) W##c32##X
#include "tyarrTemplate.h"
#define C8Arr TyArr
#define C16Arr TyArr
#define C32Arr TyArr
#undef c8 // still not sure if i want these
#undef c16
#undef c32
B m_str8(usz sz, char* s);

View File

@ -1,8 +1,3 @@
#define I8Atom i8
#define I16Atom i16
#define I32Atom i32
#define F64Atom f64
typedef struct TyArr {
struct Arr;
char a[];
@ -24,11 +19,7 @@ typedef struct TySlice {
#define TU F64
#define TP(W,X) W##f64##X
#include "tyarrTemplate.h"
#define I8Arr TyArr
#define I16Arr TyArr
#define I32Arr TyArr
#define F64Arr TyArr
#define BitArr TyArr
typedef TyArr BitArr;
// bit array stuff
#define BIT_N(IA) (((IA)+63) >> 6) // u64 count needed to store IA bits

View File

@ -1,3 +1,4 @@
#include <stdarg.h>
#include "../core.h"
#include "../utils/mut.h"
#include "../utils/utf.h"
@ -43,6 +44,13 @@ NOINLINE B m1c1_bad(Md1D* d, B x) { thrM("This 1-modifier can't be called m
NOINLINE B m1c2_bad(Md1D* d, B w, B x) { thrM("This 1-modifier can't be called dyadically"); }
NOINLINE B m2c1_bad(Md2D* d, B x) { thrM("This 2-modifier can't be called monadically"); }
NOINLINE B m2c2_bad(Md2D* d, B w, B x) { thrM("This 2-modifier can't be called dyadically"); }
NOINLINE B md_c1(B t, B x) { thrM("Cannot call a modifier"); }
NOINLINE B md_c2(B t, B w, B x) { thrM("Cannot call a modifier"); }
NOINLINE B arr_c1(B t, B x) { return inc(t); }
NOINLINE B arr_c2(B t, B w, B x) { return inc(t); }
extern B rt_under, bi_before;
static B rtUnder_c1(B f, B g, B x) { // consumes x
B fn = m2_d(inc(rt_under), inc(f), inc(g));

View File

@ -207,10 +207,11 @@ NORETURN B m1c1_bad(Md1D* d, B x);
NORETURN B m1c2_bad(Md1D* d, B w, B x);
NORETURN B m2c1_bad(Md2D* d, B x);
NORETURN B m2c2_bad(Md2D* d, B w, B x);
static B md_c1(B t, B x) { thrM("Cannot call a modifier"); }
static B md_c2(B t, B w, B x) { thrM("Cannot call a modifier"); }
static B arr_c1(B t, B x) { return inc(t); }
static B arr_c2(B t, B w, B x) { return inc(t); }
B md_c1(B t, B x);
B md_c2(B t, B w, B x);
B arr_c1(B t, B x);
B arr_c2(B t, B w, B x);
static BB2B c1fn(B f) {
if (isFun(f)) return c(Fun,f)->c1;
if (isMd(f)) return md_c1;

View File

@ -1,6 +1,8 @@
#define T_ARR TP(t_,arr)
#define T_SLICE TP(t_,slice)
#define TEl JOIN(TU,Atom)
typedef TyArr JOIN(TU,Arr);
typedef TP(,) JOIN(TU,Atom);
static B TP(m_,arrv) (TEl** p, usz ia) {
TyArr* r = m_arr(TYARR_SZ2(TU,ia), T_ARR, ia);

View File

@ -70,7 +70,6 @@
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <stdarg.h>
#include <setjmp.h>
#ifdef HEAP_VERIFY
#undef CATCH_ERRORS

View File

@ -1,3 +1,4 @@
#include <sys/mman.h>
#include "../core.h"
#include "../core/gstack.h"
#include "../ns.h"

View File

@ -1,3 +1,4 @@
#include <sys/mman.h>
#include "gc.c"
#ifdef OBJ_COUNTER

View File

@ -1,3 +1,4 @@
#include <sys/mman.h>
#include "gc.c"
#ifdef OBJ_COUNTER

View File

@ -1,5 +1,4 @@
#include "gc.h"
#include <sys/mman.h>
typedef struct EmptyValue EmptyValue;
struct EmptyValue { // needs set: mmInfo; type=t_empty; next; everything else can be garbage

View File

@ -1,4 +1,5 @@
#pragma once
#include <sys/mman.h>
#if (defined(__x86_64) || defined(__amd64__)) && defined(MAP_32BIT) && MM!=0