about summary refs log tree commit diff
path: root/src/rt/rust_abi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_abi.cpp')
-rw-r--r--src/rt/rust_abi.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rt/rust_abi.cpp b/src/rt/rust_abi.cpp
new file mode 100644
index 00000000000..98b80fb41bd
--- /dev/null
+++ b/src/rt/rust_abi.cpp
@@ -0,0 +1,10 @@
+#include <cstdlib>
+#include <stdint.h>
+#include "rust_abi.h"
+
+weak_symbol<uint32_t> abi_version("rust_abi_version");
+
+uint32_t get_abi_version() {
+    return (*abi_version == NULL) ? 0 : **abi_version;
+}
+