Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(runtime-c-api) Add support for clang in WASMER_H_MACROS #960

Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## **[Unreleased]**

- [#960](https://github.com/wasmerio/wasmer/pull/960) Fix `runtime-c-api` header files when compiled by clang.
- [#925](https://github.com/wasmerio/wasmer/pull/925) Host functions can be closures with a captured environment.
- [#917](https://github.com/wasmerio/wasmer/pull/917) Host functions (aka imported functions) may not have `&mut vm::Ctx` as first argument, i.e. the presence of the `&mut vm::Ctx` argument is optional.
- [#915](https://github.com/wasmerio/wasmer/pull/915) All backends share the same definition of `Trampoline` (defined in `wasmer-runtime-core`).
Expand Down
12 changes: 7 additions & 5 deletions lib/runtime-c-api/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@ fn main() {
out_wasmer_header_file.push("wasmer");

const WASMER_PRE_HEADER: &str = r#"
#ifndef WASMER_H_MACROS
#if !defined(WASMER_H_MACROS)
#define WASMER_H_MACROS
#if MSVC
#ifdef _M_AMD64

#if defined(MSVC)
#if defined(_M_AMD64)
#define ARCH_X86_64
#endif
#endif

#if GCC
#ifdef __x86_64__
#if defined(GCC) || defined(__clang__)
#if defined(__x86_64__)
#define ARCH_X86_64
#endif
#endif

#endif // WASMER_H_MACROS
"#;
// Generate the C bindings in the `OUT_DIR`.
Expand Down
12 changes: 7 additions & 5 deletions lib/runtime-c-api/wasmer.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@

#ifndef WASMER_H_MACROS
#if !defined(WASMER_H_MACROS)
#define WASMER_H_MACROS
#if MSVC
#ifdef _M_AMD64

#if defined(MSVC)
#if defined(_M_AMD64)
#define ARCH_X86_64
#endif
#endif

#if GCC
#ifdef __x86_64__
#if defined(GCC) || defined(__clang__)
#if defined(__x86_64__)
#define ARCH_X86_64
#endif
#endif

#endif // WASMER_H_MACROS


Expand Down
12 changes: 7 additions & 5 deletions lib/runtime-c-api/wasmer.hh
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@

#ifndef WASMER_H_MACROS
#if !defined(WASMER_H_MACROS)
#define WASMER_H_MACROS
#if MSVC
#ifdef _M_AMD64

#if defined(MSVC)
#if defined(_M_AMD64)
#define ARCH_X86_64
#endif
#endif

#if GCC
#ifdef __x86_64__
#if defined(GCC) || defined(__clang__)
#if defined(__x86_64__)
#define ARCH_X86_64
#endif
#endif

#endif // WASMER_H_MACROS


Expand Down