ref: dc90139bc05cadff6417737886073335eea185c4
parent: ec7601076a976f845bc05ad6bd3ed5b8cde58a97
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 {