~brenns10/funlisp

93e63f62e613443c9030402d596c2bf6108ffd50 — Stephen Brennan 1 year, 4 months ago 229b9e5
Remove errno hack
4 files changed, 3 insertions(+), 9 deletions(-)

M Makefile
M Makefile.dep
D src/en.c
M src/util.c
M Makefile => Makefile +1 -1
@@ 7,7 7,7 @@ include Makefile.conf

OBJS=src/builtins.o src/charbuf.o src/gc.o src/hashtable.o src/iter.o \
     src/parse.o src/ringbuf.o src/types.o src/util.o src/textcache.o \
     src/module.o src/en.o
     src/module.o

# https://semver.org
VERSION=1.1.0

M Makefile.dep => Makefile.dep +0 -1
@@ 1,7 1,6 @@
builtins.o: src/builtins.c src/funlisp_internal.h inc/funlisp.h \
 src/iter.h src/ringbuf.h src/hashtable.h
charbuf.o: src/charbuf.c src/charbuf.h
en.o: src/en.c
gc.o: src/gc.c src/funlisp_internal.h inc/funlisp.h src/iter.h \
 src/ringbuf.h src/hashtable.h
hashtable.o: src/hashtable.c src/iter.h src/hashtable.h

D src/en.c => src/en.c +0 -6
@@ 1,6 0,0 @@
#include <errno.h>

int get_errno(void)
{
	return errno;
}

M src/util.c => src/util.c +2 -1
@@ 12,6 12,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>

#include "funlisp_internal.h"
#include "hashtable.h"


@@ 424,7 425,7 @@ void lisp_print_error(lisp_runtime *rt, FILE *file)
		fprintf(file, "at line %d: ", rt->error_line);

	if (rt->err_num == LE_ERRNO) {
		errmsg = strerror(get_errno());
		errmsg = strerror(errno);
		fprintf(file, "Error %s: %s\nSystem error: %s\n",
			lisp_error_name[rt->err_num], rt->error, errmsg);
	} else {