Skip to content

Commit f9b4010

Browse files
committed
Fix the build on iOS due to missing availability annotations
1 parent 1d9b92c commit f9b4010

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Sources/TSCclibc/include/process.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,24 @@
33
#include <spawn.h>
44
#include <stdbool.h>
55

6+
#ifdef TSC_API_UNAVAILABLE_DEFINED
7+
#error TSC_API_UNAVAILABLE_DEFINED already defined
8+
#endif
9+
10+
#ifndef __API_UNAVAILABLE
11+
#define __API_UNAVAILABLE(...)
12+
#define TSC_API_UNAVAILABLE_DEFINED
13+
#endif
14+
615
// Wrapper method for posix_spawn_file_actions_addchdir_np that fails on Linux versions that do not have this method available.
7-
int SPM_posix_spawn_file_actions_addchdir_np(posix_spawn_file_actions_t *restrict file_actions, const char *restrict path);
16+
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);
817

918
// Runtime check for the availability of posix_spawn_file_actions_addchdir_np. Returns 0 if the method is available, -1 if not.
1019
bool SPM_posix_spawn_file_actions_addchdir_np_supported();
1120

21+
#ifdef TSC_API_UNAVAILABLE_DEFINED
22+
#undef TSC_API_UNAVAILABLE_DEFINED
23+
#undef __API_UNAVAILABLE
24+
#endif
25+
1226
#endif

0 commit comments

Comments
 (0)