Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions clang/ffi/load.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
#if defined(__EMSCRIPTEN__) || defined(HVM_NO_DLOPEN)

fn void ffi_load(const char *path) {
(void)path;
fprintf(stderr,
"ERROR: dynamic FFI loading not available on this platform.\n"
" Register primitives at compile time instead.\n");
exit(1);
}

#else

#include <dlfcn.h>

#define HVM_RUNTIME
Expand Down Expand Up @@ -44,3 +56,5 @@ fn void ffi_load(const char *path) {
ffi_handles_push(handle);
init(ffi_api());
}

#endif
13 changes: 13 additions & 0 deletions clang/ffi/load_dir.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#if defined(__EMSCRIPTEN__) || defined(HVM_NO_DLOPEN)

fn void ffi_load_dir(const char *dir) {
(void)dir;
fprintf(stderr,
"ERROR: dynamic FFI loading not available on this platform.\n");
exit(1);
}

#else

#include <dirent.h>
#include <sys/stat.h>

Expand Down Expand Up @@ -48,3 +59,5 @@ fn void ffi_load_dir(const char *dir) {

closedir(dp);
}

#endif