1515extern "C" {
1616#endif
1717
18+ #ifdef WASMTIME_FEATURE_GC
1819struct wasmtime_eqref ;
1920/// Convenience alias for #wasmtime_eqref
2021typedef struct wasmtime_eqref wasmtime_eqref_t ;
@@ -56,7 +57,6 @@ typedef struct wasmtime_anyref {
5657 void * __private3 ;
5758} wasmtime_anyref_t ;
5859
59- #ifdef WASMTIME_FEATURE_GC
6060/// \brief Helper function to initialize the `ref` provided to a null anyref
6161/// value.
6262static inline void wasmtime_anyref_set_null (wasmtime_anyref_t * ref ) {
@@ -72,7 +72,6 @@ static inline bool wasmtime_anyref_is_null(const wasmtime_anyref_t *ref) {
7272 return ref -> store_id == 0 ;
7373}
7474
75-
7675/**
7776 * \brief Creates a new reference pointing to the same data that `anyref`
7877 * points to (depending on the configured collector this might increase a
@@ -203,7 +202,6 @@ WASM_API_EXTERN bool wasmtime_anyref_i31_get_s(wasmtime_context_t *context,
203202 * `wasmtime_externref_set_null`. Null can be tested for with the
204203 * `wasmtime_externref_is_null` function.
205204 */
206- #endif // WASMTIME_FEATURE_GC
207205
208206typedef struct wasmtime_externref {
209207 /// Internal metadata tracking within the store, embedders should not
@@ -217,7 +215,6 @@ typedef struct wasmtime_externref {
217215 void * __private3 ;
218216} wasmtime_externref_t ;
219217
220- #ifdef WASMTIME_FEATURE_GC
221218/// \brief Helper function to initialize the `ref` provided to a null externref
222219/// value.
223220static inline void wasmtime_externref_set_null (wasmtime_externref_t * ref ) {
@@ -318,7 +315,6 @@ WASM_API_EXTERN void wasmtime_externref_from_raw(wasmtime_context_t *context,
318315 */
319316WASM_API_EXTERN uint32_t wasmtime_externref_to_raw (
320317 wasmtime_context_t * context , const wasmtime_externref_t * ref );
321- #endif // WASMTIME_FEATURE_GC
322318
323319/**
324320 * \typedef wasmtime_exnref_t
@@ -399,11 +395,12 @@ typedef uint8_t wasmtime_valkind_t;
399395/// exnref
400396#define WASMTIME_EXNREF 8
401397
398+ #endif // WASMTIME_FEATURE_GC
399+
402400/// \brief A 128-bit value representing the WebAssembly `v128` type. Bytes are
403401/// stored in little-endian order.
404402typedef uint8_t wasmtime_v128 [16 ];
405403
406-
407404/**
408405 * \typedef wasmtime_valunion_t
409406 * \brief Convenience alias for #wasmtime_valunion
@@ -423,6 +420,7 @@ typedef union wasmtime_valunion {
423420 float32_t f32 ;
424421 /// Field used if #wasmtime_val_t::kind is #WASMTIME_F64
425422 float64_t f64 ;
423+ #ifdef WASMTIME_FEATURE_GC
426424 /// Field used if #wasmtime_val_t::kind is #WASMTIME_ANYREF
427425 wasmtime_anyref_t anyref ;
428426 /// Field used if #wasmtime_val_t::kind is #WASMTIME_EXTERNREF
@@ -434,6 +432,7 @@ typedef union wasmtime_valunion {
434432 /// Use `wasmtime_funcref_is_null` to test whether this is a null function
435433 /// reference.
436434 wasmtime_func_t funcref ;
435+ #endif // WASMTIME_FEATURE_GC
437436 /// Field used if #wasmtime_val_t::kind is #WASMTIME_V128
438437 wasmtime_v128 v128 ;
439438} wasmtime_valunion_t ;
0 commit comments