diff --git a/wasmtime-wasi/sandboxed-system-primitives/src/posix.c b/wasmtime-wasi/sandboxed-system-primitives/src/posix.c index 42799ca47b..5fc6e81e5b 100644 --- a/wasmtime-wasi/sandboxed-system-primitives/src/posix.c +++ b/wasmtime-wasi/sandboxed-system-primitives/src/posix.c @@ -46,6 +46,9 @@ #include "rights.h" #include "str.h" +// static_assert is not defined in older compilers. +#ifdef static_assert + // struct iovec must have the same layout as __wasi_iovec_t. static_assert(offsetof(struct iovec, iov_base) == offsetof(__wasi_iovec_t, buf), @@ -78,6 +81,8 @@ static_assert(sizeof(((struct iovec *)0)->iov_len) == static_assert(sizeof(struct iovec) == sizeof(__wasi_ciovec_t), "Size mismatch"); +#endif + #if defined(WASMTIME_SSP_STATIC_CURFDS) static __thread struct fd_table *curfds; static __thread struct fd_prestats *prestats;