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,7 @@ typedef struct wasmtime_anyref {
5657 void * __private3 ;
5758} wasmtime_anyref_t ;
5859
59- #ifdef WASMTIME_FEATURE_GC
60+
6061/// \brief Helper function to initialize the `ref` provided to a null anyref
6162/// value.
6263static inline void wasmtime_anyref_set_null (wasmtime_anyref_t * ref ) {
@@ -203,7 +204,6 @@ WASM_API_EXTERN bool wasmtime_anyref_i31_get_s(wasmtime_context_t *context,
203204 * `wasmtime_externref_set_null`. Null can be tested for with the
204205 * `wasmtime_externref_is_null` function.
205206 */
206- #endif // WASMTIME_FEATURE_GC
207207
208208typedef struct wasmtime_externref {
209209 /// Internal metadata tracking within the store, embedders should not
@@ -217,7 +217,6 @@ typedef struct wasmtime_externref {
217217 void * __private3 ;
218218} wasmtime_externref_t ;
219219
220- #ifdef WASMTIME_FEATURE_GC
221220/// \brief Helper function to initialize the `ref` provided to a null externref
222221/// value.
223222static inline void wasmtime_externref_set_null (wasmtime_externref_t * ref ) {
@@ -318,7 +317,7 @@ WASM_API_EXTERN void wasmtime_externref_from_raw(wasmtime_context_t *context,
318317 */
319318WASM_API_EXTERN uint32_t wasmtime_externref_to_raw (
320319 wasmtime_context_t * context , const wasmtime_externref_t * ref );
321- #endif // WASMTIME_FEATURE_GC
320+
322321
323322/**
324323 * \typedef wasmtime_exnref_t
@@ -399,6 +398,8 @@ typedef uint8_t wasmtime_valkind_t;
399398/// exnref
400399#define WASMTIME_EXNREF 8
401400
401+ #endif // WASMTIME_FEATURE_GC
402+
402403/// \brief A 128-bit value representing the WebAssembly `v128` type. Bytes are
403404/// stored in little-endian order.
404405typedef uint8_t wasmtime_v128 [16 ];
@@ -423,6 +424,7 @@ typedef union wasmtime_valunion {
423424 float32_t f32 ;
424425 /// Field used if #wasmtime_val_t::kind is #WASMTIME_F64
425426 float64_t f64 ;
427+ #ifdef WASMTIME_FEATURE_GC
426428 /// Field used if #wasmtime_val_t::kind is #WASMTIME_ANYREF
427429 wasmtime_anyref_t anyref ;
428430 /// Field used if #wasmtime_val_t::kind is #WASMTIME_EXTERNREF
@@ -434,6 +436,7 @@ typedef union wasmtime_valunion {
434436 /// Use `wasmtime_funcref_is_null` to test whether this is a null function
435437 /// reference.
436438 wasmtime_func_t funcref ;
439+ #endif // WASMTIME_FEATURE_GC
437440 /// Field used if #wasmtime_val_t::kind is #WASMTIME_V128
438441 wasmtime_v128 v128 ;
439442} wasmtime_valunion_t ;
0 commit comments