From bfd5d0c9bb2e38034662134f43c41743939f58dd Mon Sep 17 00:00:00 2001 From: kvik Date: Fri, 13 Aug 2021 18:06:34 +0000 Subject: [PATCH] shim: fix size_t and ptrdiff_t definitions Prior to a recent change to 9front which made the usize type 64-bit on 64-bit machines there was no nice way to define a proper size_t, so I opted to hardcode it to uvlong, which avoided the need for patching a bunch of tricky upstream code dealing with size limits and whatnot. This, of course, made it so that Lua would only compile on 64-bit platforms. With this change Lua now builds for all the usually supported 9front platforms: amd64, 386, arm, arm64. --- shim/shim.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shim/shim.h b/shim/shim.h index 5f91628..e990f5c 100644 --- a/shim/shim.h +++ b/shim/shim.h @@ -93,8 +93,8 @@ typedef int sig_atomic_t; /** stddef.h **/ #define NULL ((void*)0) -typedef long long ptrdiff_t; -typedef unsigned long long size_t; +typedef intptr ptrdiff_t; +typedef usize size_t; /** stdio.h **/ #include "/sys/include/stdio.h" -- 2.38.5