tests/tests.h: add ARRAY_SIZE and LENGTH_OF macros
* tests/tests.h (ARRAY_SIZE, LENGTH_OF): New macros. * tests/aio.c (ARRAY_SIZE): Remove. * tests/mmsg.c (LENGTH_OF): Remove.
This commit is contained in:
parent
590b240444
commit
a5417308e4
@ -42,8 +42,6 @@
|
||||
&& defined __NR_io_destroy
|
||||
# include <linux/aio_abi.h>
|
||||
|
||||
# define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
|
@ -45,8 +45,6 @@ struct mmsghdr {
|
||||
};
|
||||
# endif
|
||||
|
||||
# define LENGTH_OF(arg) ((unsigned int) sizeof(arg) - 1)
|
||||
|
||||
static int
|
||||
send_mmsg(int fd, struct mmsghdr *vec, unsigned int vlen, unsigned int flags)
|
||||
{
|
||||
|
@ -66,6 +66,9 @@ void tprintf(const char *, ...)
|
||||
/* Make a hexdump copy of C string */
|
||||
const char *hexdump_strdup(const char *);
|
||||
|
||||
# define ARRAY_SIZE(arg) ((unsigned int) (sizeof(arg) / sizeof((arg)[0])))
|
||||
# define LENGTH_OF(arg) ((unsigned int) sizeof(arg) - 1)
|
||||
|
||||
# define SKIP_MAIN_UNDEFINED(arg) \
|
||||
int main(void) { error_msg_and_skip("undefined: %s", arg); }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user