소스 검색

Added a macro for stoopid libc that made putchar a macro

main
Ludovic 'Archivist' Lagouardette 2 달 전
부모
커밋
702af1bdbf
2개의 변경된 파일24개의 추가작업 그리고 19개의 파일을 삭제
  1. +1
    -1
      include/ink.h
  2. +23
    -18
      lib.c

+ 1
- 1
include/ink.h 파일 보기

@ -395,4 +395,4 @@ void array_push(struct context* ctx, struct ink_routine* currentRoutine, struct
#ifdef __cplusplus
};
#endif
#endif

+ 23
- 18
lib.c 파일 보기

@ -1491,6 +1491,10 @@ void ink_gc(struct context* ctx) {
/**********************************************************************************************************************/
#ifdef NUKE_PUTCHAR_MACRO
#undef putchar
#endif
static void print_stacktrace(struct context* _) {
int i;
struct ink_routine* currentRoutine;
@ -2033,6 +2037,25 @@ static void clear_stack(struct context* ctx) {
return;
}
static void is_int(struct context* ctx) {
struct ink_routine *currentRoutine;
struct elem a;
currentRoutine = ctx->routines + ctx->routine_current;
#ifndef NOEXTRACHECKS
if (currentRoutine->top < 1) {
currentRoutine->panic = -1;
return;
}
#endif
a.type = INK_INTEGER;
a.value = currentRoutine->stack[currentRoutine->top - 1].type == INK_INTEGER;
ink_pop(ctx);
ink_push(ctx, a);
}
static void dump_stack(struct context* ctx) {
struct ink_routine* currentRoutine;
int index;
@ -2373,24 +2396,6 @@ static void is_array(struct context* ctx) {
ink_push(ctx, a);
}
static void is_int(struct context* ctx) {
struct ink_routine *currentRoutine;
struct elem a;
currentRoutine = ctx->routines + ctx->routine_current;
#ifndef NOEXTRACHECKS
if (currentRoutine->top < 1) {
currentRoutine->panic = -1;
return;
}
#endif
a.type = INK_INTEGER;
a.value = currentRoutine->stack[currentRoutine->top - 1].type == INK_INTEGER;
ink_pop(ctx);
ink_push(ctx, a);
}
static void print_array_of_codepoints(struct context* ctx) {
int i;
struct ink_routine *currentRoutine;

불러오는 중...
취소
저장