Add include guard

This commit is contained in:
Brandon Fish 2019-02-09 18:07:05 -06:00
parent a0288c87ac
commit 2fa9cec0ed
3 changed files with 12 additions and 0 deletions

View File

@ -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");

View File

@ -1,3 +1,6 @@
#ifndef WASMER_H
#define WASMER_H
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
@ -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 */

View File

@ -1,3 +1,6 @@
#ifndef WASMER_H
#define WASMER_H
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
@ -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