mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-08 02:08:22 -10:00
(CI) Declare mach_port_deallocate in the apple mem_stats stub
The macos and ios arms of compile-matrix.sh compile mem_stats.c against the stub headers under scripts/stubs/apple, because no runner here has an Apple SDK. The stub mach/mach.h declares the symbols the Apple arms name; when mem_stats_free() gained the mach_port_deallocate() call that releases the send right mach_host_self() hands back, the stub was not given that declaration, so the arm has been failing on an implicit declaration ever since. The diagnostic reads like an SDK problem and is not one. A real SDK reaches mach/mach_port.h from mach/mach.h through mach/mach_interface.h, so the Apple builds themselves were never affected - only the harness that stands in for them. Adding #include <mach/mach_port.h> to mem_stats.c does not fix it either: there is no stub by that name, so the arm goes from an implicit declaration straight to a missing header, and the source ends up carrying an include that describes this harness rather than any SDK. Declare it in the stub, where the rest of the arm's symbols already are, and say in the header what it stands for so the next mach call added to mem_stats.c is followed here instead of in the source. All fifteen mem_stats arms compile clean.
This commit is contained in:
1 parent
6905998d34
commit
3074bde58e
1 file changed
+8
@@ -1,5 +1,12 @@
|
||||
#ifndef STUB_MACH_H
|
||||
#define STUB_MACH_H
|
||||
/* Stands in for the SDK's umbrella header: on a real Apple SDK
|
||||
* mach/mach.h reaches mach/mach_port.h, mach/task.h and the rest through
|
||||
* mach/mach_interface.h, so anything that chain provides is declared
|
||||
* here. A mem_stats Apple arm that starts naming a new mach symbol gets
|
||||
* its declaration added to this file - not an extra #include added to
|
||||
* mem_stats.c, which would then need a stub of its own and would still
|
||||
* be describing this harness rather than any SDK. */
|
||||
#include <stdint.h>
|
||||
typedef int kern_return_t;
|
||||
#define KERN_SUCCESS 0
|
||||
@@ -14,4 +21,5 @@ typedef struct { uint64_t phys_footprint; uint64_t limit_bytes_remaining; }
|
||||
mach_port_t mach_task_self(void);
|
||||
kern_return_t task_info(mach_port_t t, int flavor, task_info_t info,
|
||||
mach_msg_type_number_t *count);
|
||||
kern_return_t mach_port_deallocate(mach_port_t task, mach_port_t name);
|
||||
#endif
|
||||
Reference in new issue
Block a user