From b8c136eeb4772498cbd6cdbe56a2d30b833c6b71 Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 19 Nov 2022 17:18:51 +0100 Subject: [PATCH] Make a common header for attribute shorthands --- kernel/src/arch/Serial.h | 2 +- luna/Attributes.h | 6 ++++++ luna/Format.h | 2 +- luna/FormatAttribute.h | 2 -- 4 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 luna/Attributes.h delete mode 100644 luna/FormatAttribute.h diff --git a/kernel/src/arch/Serial.h b/kernel/src/arch/Serial.h index 61ca9000..097a7408 100644 --- a/kernel/src/arch/Serial.h +++ b/kernel/src/arch/Serial.h @@ -1,5 +1,5 @@ #pragma once -#include +#include #include template class Result; diff --git a/luna/Attributes.h b/luna/Attributes.h new file mode 100644 index 00000000..f137161d --- /dev/null +++ b/luna/Attributes.h @@ -0,0 +1,6 @@ +#pragma once + +#define _weak __attribute__((weak)) +#define _format(n, m) __attribute__((format(printf, n, m))) +#define _align(x) __attribute__((aligned(x))) +#define _noreturn __attribute__((noreturn)) \ No newline at end of file diff --git a/luna/Format.h b/luna/Format.h index cb63c290..fd9d95a5 100644 --- a/luna/Format.h +++ b/luna/Format.h @@ -1,6 +1,6 @@ #pragma once +#include #include -#include #include #include diff --git a/luna/FormatAttribute.h b/luna/FormatAttribute.h deleted file mode 100644 index abed32dc..00000000 --- a/luna/FormatAttribute.h +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once -#define _format(n, m) __attribute__((format(printf, n, m))) \ No newline at end of file