From 7d8a9bdb1eaea0eb9c6a80a76a3d1b9e78e45a91 Mon Sep 17 00:00:00 2001 From: Lenny Maiorani Date: Sat, 21 Nov 2020 18:02:56 -0700 Subject: [PATCH] AK: Cleanup missing includes and #ifdef evaluation Problem: - Several files have missing includes. This results in complaints from `clang-tidy`. - `#ifdef` is followed by `#elif ` which evaluates to `0`. Solution: - Add missing includes. - Change to `#elif defined()`. --- AK/Buffered.h | 5 +++++ AK/Optional.h | 1 + AK/Singleton.h | 1 + AK/SinglyLinkedListWithCount.h | 4 ++-- AK/StackInfo.cpp | 2 +- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/AK/Buffered.h b/AK/Buffered.h index e9e8d44c5fd..f671bd20fac 100644 --- a/AK/Buffered.h +++ b/AK/Buffered.h @@ -26,7 +26,12 @@ #pragma once +#include +#include +#include #include +#include +#include namespace AK { diff --git a/AK/Optional.h b/AK/Optional.h index 9fcfb1a8843..092cdc6e9f3 100644 --- a/AK/Optional.h +++ b/AK/Optional.h @@ -30,6 +30,7 @@ #include #include #include +#include namespace AK { diff --git a/AK/Singleton.h b/AK/Singleton.h index ae686a64d2b..50a54fe7482 100644 --- a/AK/Singleton.h +++ b/AK/Singleton.h @@ -28,6 +28,7 @@ #include #include +#include #include #ifdef KERNEL # include diff --git a/AK/SinglyLinkedListWithCount.h b/AK/SinglyLinkedListWithCount.h index f46daa7a82d..ec9d0196c9b 100644 --- a/AK/SinglyLinkedListWithCount.h +++ b/AK/SinglyLinkedListWithCount.h @@ -96,12 +96,12 @@ public: return List::contains_slow(value); } - using Iterator = List::Iterator; + using Iterator = typename List::Iterator; friend Iterator; Iterator begin() { return List::begin(); } Iterator end() { return List::end(); } - using ConstIterator = List::ConstIterator; + using ConstIterator = typename List::ConstIterator; friend ConstIterator; ConstIterator begin() const { return List::begin(); } ConstIterator end() const { return List::end(); } diff --git a/AK/StackInfo.cpp b/AK/StackInfo.cpp index 96f06d93bea..fb66f199dcc 100644 --- a/AK/StackInfo.cpp +++ b/AK/StackInfo.cpp @@ -30,7 +30,7 @@ #ifdef __serenity__ # include -#elif __linux__ or __APPLE__ +#elif defined(__linux__) or defined(__APPLE__) # include #endif