diff --git a/lib/runtime-c-api/build.rs b/lib/runtime-c-api/build.rs index bc8ad1af6..f78c5cf69 100644 --- a/lib/runtime-c-api/build.rs +++ b/lib/runtime-c-api/build.rs @@ -19,6 +19,7 @@ fn build() { cbindgen::Builder::new() .with_crate(crate_dir.clone()) .with_language(Language::C) + .with_include_guard("WASMER_H") .generate() .expect("Unable to generate C bindings") .write_to_file("wasmer.h"); @@ -26,6 +27,7 @@ fn build() { cbindgen::Builder::new() .with_crate(crate_dir) .with_language(Language::Cxx) + .with_include_guard("WASMER_H") .generate() .expect("Unable to generate C++ bindings") .write_to_file("wasmer.hh"); diff --git a/lib/runtime-c-api/wasmer.h b/lib/runtime-c-api/wasmer.h index 4df5001ef..0cfd919c9 100644 --- a/lib/runtime-c-api/wasmer.h +++ b/lib/runtime-c-api/wasmer.h @@ -1,3 +1,6 @@ +#ifndef WASMER_H +#define WASMER_H + #include #include #include @@ -127,3 +130,5 @@ uint32_t wasmer_table_length(wasmer_table_t *table); wasmer_table_result_t wasmer_table_new(wasmer_table_t **table, wasmer_limits_t limits); bool wasmer_validate(uint8_t *wasm_bytes, uint32_t wasm_bytes_len); + +#endif /* WASMER_H */ diff --git a/lib/runtime-c-api/wasmer.hh b/lib/runtime-c-api/wasmer.hh index 5fb292cb1..1d2c7d0af 100644 --- a/lib/runtime-c-api/wasmer.hh +++ b/lib/runtime-c-api/wasmer.hh @@ -1,3 +1,6 @@ +#ifndef WASMER_H +#define WASMER_H + #include #include #include @@ -129,3 +132,5 @@ wasmer_table_result_t wasmer_table_new(wasmer_table_t **table, wasmer_limits_t l bool wasmer_validate(uint8_t *wasm_bytes, uint32_t wasm_bytes_len); } // extern "C" + +#endif // WASMER_H