alist: Allow inclusion from OS headers

Sandbox needs to include system headers in some files, but also wants
to use alist. Adjust the headers to permit this.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-06-27 07:50:11 -06:00
parent 1f24e6ec71
commit b1936206e2
2 changed files with 12 additions and 5 deletions

View File

@@ -10,8 +10,14 @@
#define __ALIST_H #define __ALIST_H
#include <stdbool.h> #include <stdbool.h>
#include <linux/bitops.h>
#ifdef USE_HOSTCC
#include <sys/types.h>
#include <stdint.h>
#else
#include <linux/types.h> #include <linux/types.h>
#endif
#define BIT(nr) (1UL << (nr))
/** /**
* struct alist - object list that can be allocated and freed * struct alist - object list that can be allocated and freed
@@ -41,10 +47,10 @@
*/ */
struct alist { struct alist {
void *data; void *data;
u16 obj_size; unsigned short obj_size;
u16 count; unsigned short count;
u16 alloc; unsigned short alloc;
u16 flags; unsigned short flags;
}; };
/** /**

View File

@@ -8,6 +8,7 @@
#include <alist.h> #include <alist.h>
#include <display_options.h> #include <display_options.h>
#include <log.h>
#include <malloc.h> #include <malloc.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>