um: include sys/types.h for size_t

Usually size_t comes from sys/types.h, not stddef.h. This code likely
worked only because something else in its usage chain was pulling in
sys/types.h. stddef.h is still required for NULL, however, so note this.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
Jason A. Donenfeld 2022-07-17 10:53:46 +02:00 committed by Richard Weinberger
parent 8970d5c9f4
commit af3e16101c
1 changed files with 2 additions and 1 deletions

View File

@ -16,11 +16,12 @@
*/
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
/* This is to get size_t */
/* This is to get size_t and NULL */
#ifndef __UM_HOST__
#include <linux/types.h>
#else
#include <stddef.h>
#include <sys/types.h>
#endif
extern void panic(const char *fmt, ...)