global STR0/STR1 definitions
This commit is contained in:
parent
721dccf636
commit
2732becf50
@ -1718,11 +1718,7 @@ static B getPlatformNS(void) {
|
||||
#elif __arm__
|
||||
char* arch = "aarch32";
|
||||
#elif __riscv
|
||||
#define F(X) #X
|
||||
#define F2(X) F(X)
|
||||
char* arch = "riscv" F2(__riscv_xlen);
|
||||
#undef F2
|
||||
#undef F
|
||||
char* arch = "riscv" STR1(__riscv_xlen);
|
||||
#else
|
||||
char* arch = "unknown";
|
||||
#endif
|
||||
|
||||
2
src/h.h
2
src/h.h
@ -170,6 +170,8 @@ typedef size_t ux;
|
||||
|
||||
#define JOIN0(A,B) A##B
|
||||
#define JOIN(A,B) JOIN0(A,B)
|
||||
#define STR0(X) #X
|
||||
#define STR1(X) STR0(X)
|
||||
|
||||
#if USE_REPLXX_IO
|
||||
#include <replxx.h>
|
||||
|
||||
@ -4,9 +4,7 @@
|
||||
#include "ns.h"
|
||||
#include "builtins.h"
|
||||
|
||||
#define PRECOMPILED_FILE0(X) #X
|
||||
#define PRECOMPILED_FILE1(X) PRECOMPILED_FILE0(X)
|
||||
#define PRECOMPILED_FILE(END) PRECOMPILED_FILE1(../build/BYTECODE_DIR/gen/END)
|
||||
#define PRECOMPILED_FILE(END) STR1(../build/BYTECODE_DIR/gen/END)
|
||||
|
||||
#define FOR_INIT(F) \
|
||||
/* initialize primary things */ F(base) F(harr) F(mutF) F(cmpA) F(fillarr) F(tyarr) F(hash) F(sfns) F(fns) F(arithm) F(arithd) F(md1) F(md2) F(derv) F(comp) F(rtWrap) F(ns) F(nfn) F(sysfn) F(inverse) F(slash) F(search) F(transp) F(ryu) F(ffi) F(mmap) \
|
||||
|
||||
@ -5,8 +5,6 @@
|
||||
#define al BN(al)
|
||||
#define alCap BN(alCap)
|
||||
#define alSize BN(alSize)
|
||||
#define str0(X) #X
|
||||
#define str1(X) str0(X)
|
||||
|
||||
typedef struct AllocInfo {
|
||||
Value* p;
|
||||
@ -63,7 +61,7 @@ static NOINLINE void* BN(allocateMore)(i64 bucket, u8 type, i64 from, i64 to) {
|
||||
}
|
||||
|
||||
#if LOG_GC || LOG_MM_MORE
|
||||
fprintf(stderr, "allocating "N64u" more " str1(BN()) " heap (from allocation of "N64u"B/bucket %d)", sz, (u64)BSZ(bucket), (int)bucket);
|
||||
fprintf(stderr, "allocating "N64u" more " STR1(BN()) " heap (from allocation of "N64u"B/bucket %d)", sz, (u64)BSZ(bucket), (int)bucket);
|
||||
#endif
|
||||
#if NO_MMAP
|
||||
EmptyValue* c = calloc(sz+getPageSize(), 1);
|
||||
@ -197,7 +195,7 @@ void BN(dumpHeap)(FILE* f) {
|
||||
u64 addrI = ptr2u64(ci.p);
|
||||
writeNum(f, ci.sz, 8);
|
||||
writeNum(f, addrI, 8);
|
||||
char* prefix = str1(BN());
|
||||
char* prefix = STR1(BN());
|
||||
fwrite(prefix, 1, strlen(prefix)+1, f);
|
||||
fwrite(ci.p, 1, ci.sz, f);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user