Skip to content
Snippets Groups Projects
Commit 8a34f411 authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon:
Browse files

feat: static_assert! macro

parent f4de6485
No related branches found
No related tags found
1 merge request!444Gmoshkin/fix fiber detach
......@@ -45,6 +45,7 @@
has an explicit `(public = true)` attribute. `(public = false)` also works.
- `tarantool::error::Error::variant_name` method for getting name of the error
variant, because somebody needs this.
- `tarantool::static_assert` macro for adding checks that run at compile time.
### Changed
- `define_str_enum` macro now also adds `msgpack::{Encode, Decode}` implementations.
......
......@@ -67,6 +67,24 @@ macro_rules! c_ptr {
};
}
////////////////////////////////////////////////////////////////////////////////
// static_assert!
////////////////////////////////////////////////////////////////////////////////
#[macro_export]
macro_rules! static_assert {
($e:expr $(,)?) => {
const _: () = assert!($e);
};
($e:expr, $msg:expr $(,)?) => {
const _: () = assert!($e, $msg);
};
}
////////////////////////////////////////////////////////////////////////////////
// define_dlsym_reloc!
////////////////////////////////////////////////////////////////////////////////
#[macro_export]
macro_rules! define_dlsym_reloc {
(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment