diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2011-08-20 14:22:09 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2011-08-20 14:22:09 -0700 |
| commit | 25416bfae190d68d706b80903e46748da3dfadc4 (patch) | |
| tree | 31766c7eef24b3edc76a3ddceafe3bc1861170e3 /src/rt | |
| parent | 2f650038ad3e53d92203153eef03294a95daba41 (diff) | |
| download | rust-25416bfae190d68d706b80903e46748da3dfadc4.tar.gz rust-25416bfae190d68d706b80903e46748da3dfadc4.zip | |
rustc: Introduce ABI versioning so we can change value representations without breaking the compiler
Diffstat (limited to 'src/rt')
| -rw-r--r-- | src/rt/rust_abi.cpp | 10 | ||||
| -rw-r--r-- | src/rt/rust_abi.h | 4 |
2 files changed, 14 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; +} + diff --git a/src/rt/rust_abi.h b/src/rt/rust_abi.h index 1894a56f6a4..9c22ea3fe7e 100644 --- a/src/rt/rust_abi.h +++ b/src/rt/rust_abi.h @@ -1,6 +1,8 @@ #ifndef RUST_ABI_H #define RUST_ABI_H +#include <cstdlib> + #ifdef __WIN32__ #include <windows.h> #else @@ -34,5 +36,7 @@ public: T *&operator*() { fill(); return data; } }; +uint32_t get_abi_version(); + #endif |
