tests: add widen_to_ull macro to tests.h
* tests.h (widen_to_ull): New macro, copied from defs.h
This commit is contained in:
parent
70ea46756e
commit
af0d066dc2
@ -104,6 +104,14 @@ int printxval(const struct xlat *, const unsigned long long, const char *);
|
||||
# define ARRAY_SIZE(arg) ((unsigned int) (sizeof(arg) / sizeof((arg)[0])))
|
||||
# define LENGTH_OF(arg) ((unsigned int) sizeof(arg) - 1)
|
||||
|
||||
/*
|
||||
* Widen without sign-extension a signed integer type to unsigned long long.
|
||||
*/
|
||||
#define widen_to_ull(v) \
|
||||
(sizeof(v) == sizeof(int) ? (unsigned long long) (unsigned int) (v) : \
|
||||
sizeof(v) == sizeof(long) ? (unsigned long long) (unsigned long) (v) : \
|
||||
(unsigned long long) (v))
|
||||
|
||||
# define SKIP_MAIN_UNDEFINED(arg) \
|
||||
int main(void) { error_msg_and_skip("undefined: %s", arg); }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user