ref: bfd5d0c9bb2e38034662134f43c41743939f58dd
parent: 2978db7bc91bfc4a2b402d408fa59499e3ee35be
author: kvik <[email protected]>
date: Fri Aug 13 14:06:34 EDT 2021
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.
--- a/shim/shim.h
+++ b/shim/shim.h
@@ -93,8 +93,8 @@
/** 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"