Skip to content

Commit fa5e6e3

Browse files
committed
Ifdef out __wasilibc_real declarations when building wasip2
1 parent f709b21 commit fa5e6e3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

libc-bottom-half/cloudlibc/src/libc/sched/sched_yield.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
//
33
// SPDX-License-Identifier: BSD-2-Clause
44

5+
#ifndef __wasilibc_use_wasip2
56
#include <wasi/api.h>
7+
#endif
68
#include <errno.h>
79
#include <sched.h>
810

11+
#ifndef __wasilibc_use_wasip2
912
int sched_yield(void) {
1013
__wasi_errno_t error = __wasi_sched_yield();
1114
if (error != 0) {
@@ -14,3 +17,4 @@ int sched_yield(void) {
1417
}
1518
return 0;
1619
}
20+
#endif

libc-bottom-half/sources/__wasilibc_real.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* must be modified to change this file.
1111
*/
1212

13+
#ifndef __wasilibc_use_wasip2
14+
1315
#include <wasi/api.h>
1416
#include <string.h>
1517

@@ -669,3 +671,4 @@ int32_t __wasi_thread_spawn(void* start_arg) {
669671
return __imported_wasi_thread_spawn((int32_t) start_arg);
670672
}
671673
#endif
674+
#endif // __wasilibc_use_wasip2

0 commit comments

Comments
 (0)