barretenberg
Loading...
Searching...
No Matches
wasm_export.hpp
1#pragma once
2#ifdef __clang__
3#define WASM_EXPORT extern "C" __attribute__((visibility("default"))) __attribute__((annotate("wasm_export")))
4#define ASYNC_WASM_EXPORT \
5 extern "C" __attribute__((visibility("default"))) __attribute__((annotate("async_wasm_export")))
6#else
7#define WASM_EXPORT extern "C" __attribute__((visibility("default")))
8#define ASYNC_WASM_EXPORT extern "C" __attribute__((visibility("default")))
9#endif
10
11#ifdef __wasm__
12// Allow linker to not link this
13#define WASM_IMPORT(name) extern "C" __attribute__((import_module("env"), import_name(name)))
14#else
15#define WASM_IMPORT(name) extern "C"
16#endif