Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/wapython
Path: blob/main/core/posix-wasm/src/emscripten.h
1067 views
1
/*
2
Compatibility for things that assume they are building against emscripten,
3
e.g., Python.
4
*/
5
6
#pragma once
7
8
#define EM_IMPORT(NAME)
9
10
#define _EM_JS(ret, c_name, js_name, params, code) \
11
ret c_name params EM_IMPORT(js_name); \
12
EMSCRIPTEN_KEEPALIVE \
13
__attribute__((section("em_js"), aligned(1))) char __em_js__##js_name[] = \
14
#params "<::>" code; \
15
16
#define EM_JS(ret, name, params, ...) \
17
_EM_JS(ret, name, name, params, #__VA_ARGS__)
18
19
#define EMSCRIPTEN_KEEPALIVE
20
21