shithub: sl

Download patch

ref: 7f0e17d5f8f2920c500ac9e0a0fdde974d9fb512
parent: efd31d89aa3295d20c520b7758a4588c85ed6f44
author: Lassi Kortela <lassi@lassi.io>
date: Wed Feb 26 06:00:08 EST 2020

Fix 64-bit builds of tiny interpreters

--- a/tiny/lisp-nontail.c
+++ b/tiny/lisp-nontail.c
@@ -26,8 +26,13 @@
 #include <ctype.h>
 #include <sys/types.h>
 
+#ifdef __LP64__
+typedef u_int64_t value_t;
+typedef int64_t number_t;
+#else
 typedef u_int32_t value_t;
 typedef int32_t number_t;
+#endif
 
 typedef struct {
     value_t car;
--- a/tiny/lisp2.c
+++ b/tiny/lisp2.c
@@ -47,8 +47,13 @@
 #include <ctype.h>
 #include <sys/types.h>
 
+#ifdef __LP64__
+typedef u_int64_t value_t;
+typedef int64_t number_t;
+#else
 typedef u_int32_t value_t;
 typedef int32_t number_t;
+#endif
 
 typedef struct {
     value_t car;
--- a/tiny/lispf.c
+++ b/tiny/lispf.c
@@ -32,11 +32,20 @@
 #include <ctype.h>
 #include <sys/types.h>
 
+#ifdef __LP64__
+typedef u_int64_t value_t;
+#else
 typedef u_int32_t value_t;
+#endif
+
 #ifdef FLOAT
 typedef float number_t;
 #else
+#ifdef __LP64__
+typedef int64_t number_t;
+#else
 typedef int32_t number_t;
+#endif
 #endif
 
 typedef struct {