From 97d7bd5561d3cc4520d0c7d2ff2ceece58ffa0bc Mon Sep 17 00:00:00 2001 From: "Oleg N. Cher" Date: Wed, 22 Nov 2023 07:02:25 +0200 Subject: [PATCH] * macOS: fix SYSTEM.* for Clang 15.0.0 --- Mod/Lib/Heap.cp | 15 +++++++++------ Mod/Lib/SYSTEM.c | 2 +- Mod/Lib/SYSTEM.oh | 8 ++++---- Target/Win32/ofront+.exe | Bin 225280 -> 225280 bytes 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Mod/Lib/Heap.cp b/Mod/Lib/Heap.cp index 26c69b75..151be540 100644 --- a/Mod/Lib/Heap.cp +++ b/Mod/Lib/Heap.cp @@ -164,14 +164,15 @@ MODULE Heap; END FreeModule; - PROCEDURE REGCMD* (m: Module; IN name: ARRAY OF SHORTCHAR; cmd: Command); - VAR c: Cmd; + PROCEDURE REGCMD* (mod: S.PTR; IN name: ARRAY OF SHORTCHAR; cmd: Command); + VAR c: Cmd; m: Module; BEGIN ASSERT(LEN(name$) < CmdNameLen, 114); (* REGCMD is called during module initialization code before that modules type descriptors have been set up. 'NEW' depends on the Heap modules type descriptors being ready for use, therefore, just for the commands registered by the Heap module itself, we must use S.NEW. *) + m := mod; IF m.name = "Heap" THEN S.NEW(c, SIZE(CmdDesc)) ELSE @@ -180,12 +181,14 @@ MODULE Heap; c.name := name$; c.cmd := cmd; c.next := m.cmds; m.cmds := c END REGCMD; - PROCEDURE REGTYP*(m: Module; typ: ADDRESS); - BEGIN S.PUT(typ, m.types); m.types := typ + PROCEDURE REGTYP* (mod: S.PTR; typ: ADDRESS); + VAR m: Module; + BEGIN m := mod; S.PUT(typ, m.types); m.types := typ END REGTYP; - PROCEDURE INCREF*(m: Module); - BEGIN INC(m.refcnt) + PROCEDURE INCREF* (mod: S.PTR); + VAR m: Module; + BEGIN m := mod; INC(m.refcnt) END INCREF; diff --git a/Mod/Lib/SYSTEM.c b/Mod/Lib/SYSTEM.c index 40fa94c8..1dd18e99 100644 --- a/Mod/Lib/SYSTEM.c +++ b/Mod/Lib/SYSTEM.c @@ -167,7 +167,7 @@ void SYSTEM_INHERIT(SYSTEM_ADRINT *t, SYSTEM_ADRINT *t0) void SYSTEM_ENUMP(void *adr, SYSTEM_ADRINT n, void (*P)(void*)) { while (n > 0) { - P((void*)(*((void**)(adr)))); + P(*((void**)(adr))); adr = ((void**)adr) + 1; n--; } diff --git a/Mod/Lib/SYSTEM.oh b/Mod/Lib/SYSTEM.oh index 7438e247..2086da2e 100644 --- a/Mod/Lib/SYSTEM.oh +++ b/Mod/Lib/SYSTEM.oh @@ -397,10 +397,10 @@ static inline REAL __MAXFD (REAL x, REAL y) { return x>y?x:y; } // Module entry/registration/exit -extern void Heap_REGCMD(); -extern SYSTEM_PTR Heap_REGMOD(); -extern void Heap_REGTYP(); -extern void Heap_INCREF(); +extern void Heap_REGCMD (SYSTEM_PTR m, CHAR *name, INTEGER name__len, void (*cmd)(void)); +extern SYSTEM_PTR Heap_REGMOD (CHAR *name, INTEGER name__len, void (*enumPtrs)(void(*)(SYSTEM_PTR))); +extern void Heap_REGTYP (SYSTEM_PTR m, SYSTEM_ADRINT typ); +extern void Heap_INCREF (SYSTEM_PTR m); #define __DEFMOD static void *m; if (m!=0) {return m;} #define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, 24, cmd) diff --git a/Target/Win32/ofront+.exe b/Target/Win32/ofront+.exe index d3943e97e01322573290067302983ec1bdbe2a23..18553391d341b56a578c96f816ed3073e1076037 100644 GIT binary patch delta 44 zcmV+{0Mq|~;0=J_4UmWf*@|6}i%kRVp96v0h1&tO+X4l50koIlcLF~FwYMR70^j${ CjTAos delta 44 zcmV+{0Mq|~;0=J_4UmWf{sdf+i%kO#8U%sch1&tO+X4l50kfCkcLF~Fw6`I60^j$U CNfLMf