libweston: move TYPEVERIFY macro into shared
This will be useful in the test harness macros. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
committed by
Pekka Paalanen
parent
69039ceb43
commit
eb5a95bfc9
@@ -134,6 +134,14 @@ extern "C" {
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/** Ensure argument is of given type */
|
||||
#ifndef TYPEVERIFY
|
||||
#define TYPEVERIFY(type, arg) ({ \
|
||||
typeof(arg) tmp___ = (arg); \
|
||||
(void)((type)0 == tmp___); \
|
||||
tmp___; })
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user