macro_rules! as_cptr {
($vec:expr) => { ... };
}Expand description
Helper macro to convert a Vec to a pointer, returning NULL if the Vec is empty.
This is useful for CK_ATTRIBUTE pValue fields, to avoid dangling pointers present in empty vectors to be converted as e.g. 0x01 for the C layer, which may lead to issues, as 0x01 is arguably no longer NULL and could be dereferenced.
See Vec::as_ptr() documentation for more details on the issue.