From 0a6a06f7cb86f2bf59d1792003659f6406635eea Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Tue, 10 Jun 2025 12:58:19 -0700 Subject: [PATCH] Fix the build on iOS due to missing availability annotations --- Sources/TSCclibc/include/process.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Sources/TSCclibc/include/process.h b/Sources/TSCclibc/include/process.h index da96606b..08c57f37 100644 --- a/Sources/TSCclibc/include/process.h +++ b/Sources/TSCclibc/include/process.h @@ -3,10 +3,24 @@ #include #include +#ifdef TSC_API_UNAVAILABLE_DEFINED +#error TSC_API_UNAVAILABLE_DEFINED already defined +#endif + +#ifndef __API_UNAVAILABLE +#define __API_UNAVAILABLE(...) +#define TSC_API_UNAVAILABLE_DEFINED +#endif + // Wrapper method for posix_spawn_file_actions_addchdir_np that fails on Linux versions that do not have this method available. -int SPM_posix_spawn_file_actions_addchdir_np(posix_spawn_file_actions_t *restrict file_actions, const char *restrict path); +int SPM_posix_spawn_file_actions_addchdir_np(posix_spawn_file_actions_t *restrict file_actions, const char *restrict path) __API_UNAVAILABLE(ios, tvos, watchos, visionos); // Runtime check for the availability of posix_spawn_file_actions_addchdir_np. Returns 0 if the method is available, -1 if not. bool SPM_posix_spawn_file_actions_addchdir_np_supported(); +#ifdef TSC_API_UNAVAILABLE_DEFINED +#undef TSC_API_UNAVAILABLE_DEFINED +#undef __API_UNAVAILABLE +#endif + #endif