Skip to content

Commit 4beef48

Browse files
committed
Adds more wasmtime_feature_gc gate, and moves some definition outside the gate
1 parent c575d98 commit 4beef48

4 files changed

Lines changed: 9 additions & 2 deletions

File tree

crates/c-api/include/wasmtime/gc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#ifndef WASMTIME_GC_H
1212
#define WASMTIME_GC_H
1313

14+
#ifdef WASMTIME_FEATURE_GC
15+
1416
#include <wasmtime/val.h>
1517

1618
#ifdef __cplusplus
@@ -593,4 +595,5 @@ WASM_API_EXTERN bool wasmtime_anyref_as_array(wasmtime_context_t *context,
593595
} // extern "C"
594596
#endif
595597

598+
#endif // WASMTIME_FEATURE_GC
596599
#endif // WASMTIME_GC_H

crates/c-api/include/wasmtime/gc.hh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#ifndef WASMTIME_GC_HH
88
#define WASMTIME_GC_HH
99

10+
#ifdef WASMTIME_FEATURE_GC
1011
#include <vector>
1112
#include <wasmtime/gc.h>
1213
#include <wasmtime/val.hh>
@@ -476,4 +477,6 @@ inline std::optional<ArrayRef> AnyRef::as_array(Store::Context cx) const {
476477

477478
} // namespace wasmtime
478479

480+
#endif // WASMTIME_FEATURE_GC
481+
479482
#endif // WASMTIME_GC_HH

crates/c-api/include/wasmtime/val.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ WASM_API_EXTERN void wasmtime_exnref_clone(const wasmtime_exnref_t *ref,
369369
* After this call, `ref` is left in an undefined state and should not be used.
370370
*/
371371
WASM_API_EXTERN void wasmtime_exnref_unroot(wasmtime_exnref_t *ref);
372+
#endif // WASMTIME_FEATURE_GC
372373

373374
/// \brief Discriminant stored in #wasmtime_val::kind
374375
typedef uint8_t wasmtime_valkind_t;
@@ -395,8 +396,6 @@ typedef uint8_t wasmtime_valkind_t;
395396
/// exnref
396397
#define WASMTIME_EXNREF 8
397398

398-
#endif // WASMTIME_FEATURE_GC
399-
400399
/// \brief A 128-bit value representing the WebAssembly `v128` type. Bytes are
401400
/// stored in little-endian order.
402401
typedef uint8_t wasmtime_v128[16];

crates/c-api/include/wasmtime/val.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
#define WASMTIME_VAL_HH
77

88
#include <optional>
9+
#ifdef WASMTIME_FEATURE_GC
910
#include <wasmtime/gc.h>
11+
#endif // WASMTIME_FEATURE_GC
1012
#include <wasmtime/store.hh>
1113
#include <wasmtime/types/val.hh>
1214
#include <wasmtime/val.h>

0 commit comments

Comments
 (0)