auto merge of #8534 : huonw/rust/tls-key-macro, r=alexcrichton
This allows the internal implementation details of the TLS keys to be changed without requiring the update of all the users. (Or, applying changes that *have* to be applied for the keys to work correctly, e.g. forcing LLVM to not merge these constants.)
This commit is contained in:
@@ -957,6 +957,17 @@ pub fn std_macros() -> @str {
|
||||
println(fmt!($($arg),+))
|
||||
)
|
||||
)
|
||||
|
||||
// NOTE: use this after a snapshot lands to abstract the details
|
||||
// of the TLS interface.
|
||||
macro_rules! local_data_key (
|
||||
($name:ident: $ty:ty) => (
|
||||
static $name: ::std::local_data::Key<$ty> = &::std::local_data::Key;
|
||||
);
|
||||
(pub $name:ident: $ty:ty) => (
|
||||
pub static $name: ::std::local_data::Key<$ty> = &::std::local_data::Key;
|
||||
)
|
||||
)
|
||||
}";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user