Tactility/Modules/app-posix-module/source/stdio_wrap_apple.cpp
Ken Van Hoeylandt 3a7db7a801
Various improvements (#690)
* **New Features**
  * Added App Hub browsing with All, Installed, and Updates filters, plus options to install, remove, or update apps.
  * Added an installation activity indicator in the status bar.
  * Added a mesh command-line app for checking status and managing mesh settings and channels.
  * Radio region settings now persist across restarts and are applied to radio devices.
  * Added audio codec support for the LilyGo T-LoRa Pager.
  * Settings screens now use icons for selection actions.
* **Improvements**
  * App Hub displays cached catalog results while a refresh is in progress.
  * System menu close controls receive focus automatically when no pointer is available.
2026-10-13 08:37:59 +02:00

63 lines
2.2 KiB
C++

// SPDX-License-Identifier: Apache-2.0
#ifdef __APPLE__
#include <app_posix/stdio_wrap.h>
#include <cstdlib>
#include <sys/ioctl.h>
#include <unistd.h>
// <mach-o/dyld-interposing.h> isn't a public SDK header, so reimplemented locally.
#define TT_DYLD_INTERPOSE(replacement, replacee) \
__attribute__((used)) static struct { const void* replacement; const void* replacee; } \
tt_interpose_##replacee __attribute__((section("__DATA,__interpose"))) = { \
(const void*)(unsigned long)&(replacement), (const void*)(unsigned long)&(replacee) \
};
TT_DYLD_INTERPOSE(__wrap_read, read)
TT_DYLD_INTERPOSE(__wrap_write, write)
TT_DYLD_INTERPOSE(__wrap_ioctl, ioctl)
TT_DYLD_INTERPOSE(__wrap_close, close)
TT_DYLD_INTERPOSE(__wrap_getcwd, getcwd)
TT_DYLD_INTERPOSE(__wrap_chdir, chdir)
TT_DYLD_INTERPOSE(__wrap_fstat, fstat)
TT_DYLD_INTERPOSE(__wrap_poll, poll)
TT_DYLD_INTERPOSE(__wrap_tcgetattr, tcgetattr)
TT_DYLD_INTERPOSE(__wrap_tcsetattr, tcsetattr)
TT_DYLD_INTERPOSE(__wrap_exit, exit)
TT_DYLD_INTERPOSE(__wrap_signal, signal)
TT_DYLD_INTERPOSE(__wrap_kill, kill)
TT_DYLD_INTERPOSE(__wrap_getpid, getpid)
TT_DYLD_INTERPOSE(__wrap_getppid, getppid)
TT_DYLD_INTERPOSE(__wrap_usleep, usleep)
TT_DYLD_INTERPOSE(__wrap_sleep, sleep)
TT_DYLD_INTERPOSE(__wrap_open, open)
TT_DYLD_INTERPOSE(__wrap_fopen, fopen)
TT_DYLD_INTERPOSE(__wrap_stat, stat)
TT_DYLD_INTERPOSE(__wrap_lstat, lstat)
TT_DYLD_INTERPOSE(__wrap_access, access)
TT_DYLD_INTERPOSE(__wrap_unlink, unlink)
TT_DYLD_INTERPOSE(__wrap_remove, remove)
TT_DYLD_INTERPOSE(__wrap_rename, rename)
TT_DYLD_INTERPOSE(__wrap_mkdir, mkdir)
TT_DYLD_INTERPOSE(__wrap_rmdir, rmdir)
TT_DYLD_INTERPOSE(__wrap_opendir, opendir)
TT_DYLD_INTERPOSE(__wrap_truncate, truncate)
TT_DYLD_INTERPOSE(__wrap_vprintf, vprintf)
TT_DYLD_INTERPOSE(__wrap_printf, printf)
TT_DYLD_INTERPOSE(__wrap_vfprintf, vfprintf)
TT_DYLD_INTERPOSE(__wrap_fprintf, fprintf)
TT_DYLD_INTERPOSE(__wrap_puts, puts)
TT_DYLD_INTERPOSE(__wrap_fputs, fputs)
TT_DYLD_INTERPOSE(__wrap_putchar, putchar)
TT_DYLD_INTERPOSE(__wrap_fputc, fputc)
TT_DYLD_INTERPOSE(__wrap_fputc, putc)
TT_DYLD_INTERPOSE(__wrap_fwrite, fwrite)
TT_DYLD_INTERPOSE(__wrap_getchar, getchar)
TT_DYLD_INTERPOSE(__wrap_fgetc, fgetc)
TT_DYLD_INTERPOSE(__wrap_fgets, fgets)
#endif // __APPLE__