From: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx> Support nolibc build for aarch64. While in there, don't indent the block inside #if / #elif / #else / #endif. Signed-off-by: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx> --- src/lib.h | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/lib.h b/src/lib.h index e5f3680..399467c 100644 --- a/src/lib.h +++ b/src/lib.h @@ -7,28 +7,30 @@ #include <unistd.h> #if defined(__x86_64__) || defined(__i386__) - #include "arch/x86/lib.h" +#include "arch/x86/lib.h" +#elif defined(__aarch64__) +#include "arch/aarch64/lib.h" #else - /* - * We don't have nolibc support for this arch. Must use libc! - */ - #ifdef CONFIG_NOLIBC - #error "This arch doesn't support building liburing without libc" - #endif - /* libc wrappers. */ - #include "arch/generic/lib.h" +/* + * We don't have nolibc support for this arch. Must use libc! + */ +#ifdef CONFIG_NOLIBC +#error "This arch doesn't support building liburing without libc" +#endif +/* libc wrappers. */ +#include "arch/generic/lib.h" #endif #ifndef offsetof - #define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD) +#define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD) #endif #ifndef container_of - #define container_of(PTR, TYPE, FIELD) ({ \ - __typeof__(((TYPE *)0)->FIELD) *__FIELD_PTR = (PTR); \ - (TYPE *)((char *) __FIELD_PTR - offsetof(TYPE, FIELD)); \ - }) +#define container_of(PTR, TYPE, FIELD) ({ \ + __typeof__(((TYPE *)0)->FIELD) *__FIELD_PTR = (PTR); \ + (TYPE *)((char *) __FIELD_PTR - offsetof(TYPE, FIELD)); \ +}) #endif void *__uring_malloc(size_t len); -- Ammar Faizi