From 71141e8cf5dfaf5d17610dba57f0e0f319a4850e Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sun, 26 Nov 2023 17:25:35 +0100 Subject: [PATCH] build(IWYU): fix headers for arabic.h --- Makefile | 1 - cmake.config/iwyu/mapping.imp | 1 + src/clint.py | 1 - src/nvim/arabic.h | 4 +--- src/nvim/arabic_defs.h | 3 +++ src/nvim/event/libuv_process.c | 1 - src/nvim/spellsuggest.h | 2 +- 7 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 src/nvim/arabic_defs.h diff --git a/Makefile b/Makefile index 63ee6f30c9..2102e931e9 100644 --- a/Makefile +++ b/Makefile @@ -160,7 +160,6 @@ iwyu: build/.ran-cmake |src/nvim/api/vimscript.h\ |src/nvim/api/win_config.h\ |src/nvim/api/window.h\ - |src/nvim/arabic.h\ |src/nvim/arglist.h\ |src/nvim/ascii.h\ |src/nvim/assert.h\ diff --git a/cmake.config/iwyu/mapping.imp b/cmake.config/iwyu/mapping.imp index 90c4ea36bc..9a433714dc 100644 --- a/cmake.config/iwyu/mapping.imp +++ b/cmake.config/iwyu/mapping.imp @@ -195,6 +195,7 @@ # headers on the left, it will use the headers on the right if possible. This # isn't explicitly mentioned in the IWYU docs, this is just my interpretation # of its behavior. + { include: [ '"nvim/arabic_defs.h"', public, '"nvim/arabic.h"', public ] }, { include: [ '"nvim/arglist_defs.h"', public, '"nvim/arglist.h"', public ] }, { include: [ '"nvim/buffer_defs.h"', public, '"nvim/buffer.h"', public ] }, { include: [ '"nvim/cmdexpand_defs.h"', public, '"nvim/cmdexpand.h"', public ] }, diff --git a/src/clint.py b/src/clint.py index 79c916c0b9..6676673afc 100755 --- a/src/clint.py +++ b/src/clint.py @@ -914,7 +914,6 @@ def CheckIncludes(filename, lines, error): "src/nvim/api/vimscript.h", "src/nvim/api/win_config.h", "src/nvim/api/window.h", - "src/nvim/arabic.h", "src/nvim/arglist.h", "src/nvim/ascii.h", "src/nvim/assert.h", diff --git a/src/nvim/arabic.h b/src/nvim/arabic.h index 2d09531331..9b3c5b6cee 100644 --- a/src/nvim/arabic.h +++ b/src/nvim/arabic.h @@ -1,8 +1,6 @@ #pragma once -#include - -#define ARABIC_CHAR(ch) (((ch) & 0xFF00) == 0x0600) +#include "nvim/arabic_defs.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "arabic.h.generated.h" diff --git a/src/nvim/arabic_defs.h b/src/nvim/arabic_defs.h new file mode 100644 index 0000000000..605ae7603a --- /dev/null +++ b/src/nvim/arabic_defs.h @@ -0,0 +1,3 @@ +#pragma once + +#define ARABIC_CHAR(ch) (((ch) & 0xFF00) == 0x0600) diff --git a/src/nvim/event/libuv_process.c b/src/nvim/event/libuv_process.c index 2f21fcf2ac..8264adb1fc 100644 --- a/src/nvim/event/libuv_process.c +++ b/src/nvim/event/libuv_process.c @@ -5,7 +5,6 @@ #include "nvim/eval/typval.h" #include "nvim/event/libuv_process.h" -#include "nvim/event/loop.h" #include "nvim/event/process.h" #include "nvim/event/stream.h" #include "nvim/log.h" diff --git a/src/nvim/spellsuggest.h b/src/nvim/spellsuggest.h index a0acc3cc50..0100e44b07 100644 --- a/src/nvim/spellsuggest.h +++ b/src/nvim/spellsuggest.h @@ -1,6 +1,6 @@ #pragma once -#include "nvim/garray_defs.h" +#include "nvim/garray_defs.h" // IWYU pragma: export #ifdef INCLUDE_GENERATED_DECLARATIONS # include "spellsuggest.h.generated.h"