diff options
author | Daniel Lange <DLange@git.local> | 2023-11-29 17:44:20 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2023-12-26 15:14:19 +0100 |
commit | 179aeb01082df9e7c19a285ae4d703a7714f4e2f (patch) | |
tree | 4e4c6d0ae1ba68be493025a90286c969e0fd7567 | |
parent | 8980d7a896439f923861ea0810b4e4c36b757d4a (diff) |
Add includes for config.h as per the discussion in PR #1337
Many thanks to @Explorer09 Kang-Che Sung (宋岡哲).
Also add a #error stanza to XUtils.h in case somebody forgets the beautiful mess GNU forces on us.
47 files changed, 98 insertions, 1 deletions
diff --git a/AvailableColumnsPanel.c b/AvailableColumnsPanel.c index a590bac2..1b328db0 100644 --- a/AvailableColumnsPanel.c +++ b/AvailableColumnsPanel.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "AvailableColumnsPanel.h" #include <assert.h> diff --git a/AvailableMetersPanel.c b/AvailableMetersPanel.c index de1dd211..dabb3870 100644 --- a/AvailableMetersPanel.c +++ b/AvailableMetersPanel.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "AvailableMetersPanel.h" #include <assert.h> diff --git a/BatteryMeter.c b/BatteryMeter.c index 24b2e682..92eecb3f 100644 --- a/BatteryMeter.c +++ b/BatteryMeter.c @@ -7,6 +7,8 @@ in the source distribution for its full text. This meter written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com). */ +#include "config.h" // IWYU pragma: keep + #include "BatteryMeter.h" #include <math.h> diff --git a/CategoriesPanel.c b/CategoriesPanel.c index 31c7da05..d653dcbd 100644 --- a/CategoriesPanel.c +++ b/CategoriesPanel.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "CategoriesPanel.h" #include <ctype.h> diff --git a/ColumnsPanel.c b/ColumnsPanel.c index e3445a00..f395d9f6 100644 --- a/ColumnsPanel.c +++ b/ColumnsPanel.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "ColumnsPanel.h" #include <assert.h> diff --git a/DiskIOMeter.c b/DiskIOMeter.c index 9740db47..78ae91b6 100644 --- a/DiskIOMeter.c +++ b/DiskIOMeter.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "DiskIOMeter.h" #include <stdbool.h> diff --git a/DynamicScreen.c b/DynamicScreen.c index 35eb4ee6..6ab52541 100644 --- a/DynamicScreen.c +++ b/DynamicScreen.c @@ -6,6 +6,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "DynamicScreen.h" #include <stdbool.h> diff --git a/FileDescriptorMeter.c b/FileDescriptorMeter.c index 92dc99ae..4295f21a 100644 --- a/FileDescriptorMeter.c +++ b/FileDescriptorMeter.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "FileDescriptorMeter.h" #include <math.h> @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "Header.h" #include <assert.h> diff --git a/LoadAverageMeter.c b/LoadAverageMeter.c index be6215db..0a8e7f19 100644 --- a/LoadAverageMeter.c +++ b/LoadAverageMeter.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "LoadAverageMeter.h" #include "CRT.h" @@ -6,6 +6,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "Machine.h" #include <stdlib.h> diff --git a/MainPanel.c b/MainPanel.c index 7ca7b201..05093f12 100644 --- a/MainPanel.c +++ b/MainPanel.c @@ -6,6 +6,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "MainPanel.h" #include <ctype.h> diff --git a/MemorySwapMeter.c b/MemorySwapMeter.c index 814841f7..0d89ced6 100644 --- a/MemorySwapMeter.c +++ b/MemorySwapMeter.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "MemorySwapMeter.h" #include <assert.h> diff --git a/NetworkIOMeter.c b/NetworkIOMeter.c index ea7ffba2..a43f4d17 100644 --- a/NetworkIOMeter.c +++ b/NetworkIOMeter.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "NetworkIOMeter.h" #include <stdbool.h> diff --git a/OptionItem.c b/OptionItem.c index 962c0a9c..728113b9 100644 --- a/OptionItem.c +++ b/OptionItem.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "OptionItem.h" #include <assert.h> @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "Panel.h" #include <assert.h> diff --git a/RichString.c b/RichString.c index daa0c91f..ed852ada 100644 --- a/RichString.c +++ b/RichString.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "RichString.h" #include <ctype.h> diff --git a/Scheduling.c b/Scheduling.c index 10846c0b..8383cb10 100644 --- a/Scheduling.c +++ b/Scheduling.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "Scheduling.h" #include "EnvScreen.h" diff --git a/ScreenTabsPanel.c b/ScreenTabsPanel.c index 571db71f..d4757f05 100644 --- a/ScreenTabsPanel.c +++ b/ScreenTabsPanel.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "ScreenTabsPanel.h" #include <ctype.h> diff --git a/ScreensPanel.c b/ScreensPanel.c index 1bf557a3..69d1aeb1 100644 --- a/ScreensPanel.c +++ b/ScreensPanel.c @@ -6,6 +6,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "ScreensPanel.h" #include <stdlib.h> @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "Settings.h" #include <ctype.h> diff --git a/SignalsPanel.c b/SignalsPanel.c index 7e21ce93..28d307e2 100644 --- a/SignalsPanel.c +++ b/SignalsPanel.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "SignalsPanel.h" // the above contains #include <signal.h> so do not add that here again (breaks Solaris build) diff --git a/TasksMeter.c b/TasksMeter.c index 6ea965b8..04b1f938 100644 --- a/TasksMeter.c +++ b/TasksMeter.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "TasksMeter.h" #include "CRT.h" diff --git a/UptimeMeter.c b/UptimeMeter.c index d4b3175e..622deda3 100644 --- a/UptimeMeter.c +++ b/UptimeMeter.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "UptimeMeter.h" #include "CRT.h" @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "Vector.h" #include <assert.h> @@ -3,11 +3,16 @@ /* htop - StringUtils.h (C) 2004-2011 Hisham H. Muhammad +(C) 2020-2023 htop dev team Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ -#include "config.h" // IWYU pragma: keep +// IWYU pragma: no_include "config.h" +#ifndef PACKAGE +// strchrnul() needs _GNU_SOURCE defined, see PR #1337 for details +#error "Must have #include \"config.h\" line at the top of the file that includes these XUtils helper functions" +#endif #include <stdbool.h> #include <stdio.h> diff --git a/dragonflybsd/Platform.c b/dragonflybsd/Platform.c index ff2300aa..25afa8b1 100644 --- a/dragonflybsd/Platform.c +++ b/dragonflybsd/Platform.c @@ -6,6 +6,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "dragonflybsd/Platform.h" #include <math.h> diff --git a/freebsd/FreeBSDProcess.c b/freebsd/FreeBSDProcess.c index f6d3451d..bf8879a9 100644 --- a/freebsd/FreeBSDProcess.c +++ b/freebsd/FreeBSDProcess.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "freebsd/FreeBSDProcess.h" #include <stdlib.h> diff --git a/linux/CGroupUtils.c b/linux/CGroupUtils.c index 60922c6e..62924542 100644 --- a/linux/CGroupUtils.c +++ b/linux/CGroupUtils.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "linux/CGroupUtils.h" #include "XUtils.h" diff --git a/linux/IOPriorityPanel.c b/linux/IOPriorityPanel.c index 3e91bc4d..8d0ef7b5 100644 --- a/linux/IOPriorityPanel.c +++ b/linux/IOPriorityPanel.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "linux/IOPriorityPanel.h" #include <stdbool.h> diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c index 4655d91b..8b119fd9 100644 --- a/linux/LinuxProcess.c +++ b/linux/LinuxProcess.c @@ -6,6 +6,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "linux/LinuxProcess.h" #include <math.h> diff --git a/linux/PressureStallMeter.c b/linux/PressureStallMeter.c index c4f534ea..f7962475 100644 --- a/linux/PressureStallMeter.c +++ b/linux/PressureStallMeter.c @@ -6,6 +6,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "linux/PressureStallMeter.h" #include <stdbool.h> diff --git a/linux/SELinuxMeter.c b/linux/SELinuxMeter.c index c35cb686..323c2a17 100644 --- a/linux/SELinuxMeter.c +++ b/linux/SELinuxMeter.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "linux/SELinuxMeter.h" #include "CRT.h" diff --git a/linux/SystemdMeter.c b/linux/SystemdMeter.c index ff178e0e..a154d1b8 100644 --- a/linux/SystemdMeter.c +++ b/linux/SystemdMeter.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "linux/SystemdMeter.h" #include <dlfcn.h> diff --git a/netbsd/NetBSDMachine.c b/netbsd/NetBSDMachine.c index 245b8231..9c04cdd3 100644 --- a/netbsd/NetBSDMachine.c +++ b/netbsd/NetBSDMachine.c @@ -8,6 +8,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "netbsd/NetBSDMachine.h" #include <kvm.h> diff --git a/netbsd/NetBSDProcess.c b/netbsd/NetBSDProcess.c index 605b56c8..4166f962 100644 --- a/netbsd/NetBSDProcess.c +++ b/netbsd/NetBSDProcess.c @@ -8,6 +8,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "netbsd/NetBSDProcess.h" #include <stdlib.h> diff --git a/netbsd/NetBSDProcessTable.c b/netbsd/NetBSDProcessTable.c index 885a2edd..6fa5bfea 100644 --- a/netbsd/NetBSDProcessTable.c +++ b/netbsd/NetBSDProcessTable.c @@ -8,6 +8,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "netbsd/NetBSDProcessTable.h" #include <kvm.h> diff --git a/netbsd/Platform.c b/netbsd/Platform.c index 5b09ed16..f458c239 100644 --- a/netbsd/Platform.c +++ b/netbsd/Platform.c @@ -9,6 +9,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "netbsd/Platform.h" #include <errno.h> diff --git a/openbsd/OpenBSDMachine.c b/openbsd/OpenBSDMachine.c index c4b6e47e..0edb90be 100644 --- a/openbsd/OpenBSDMachine.c +++ b/openbsd/OpenBSDMachine.c @@ -6,6 +6,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "openbsd/OpenBSDMachine.h" #include <kvm.h> diff --git a/openbsd/OpenBSDProcess.c b/openbsd/OpenBSDProcess.c index c54a1763..b1958a15 100644 --- a/openbsd/OpenBSDProcess.c +++ b/openbsd/OpenBSDProcess.c @@ -6,6 +6,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "openbsd/OpenBSDProcess.h" #include <stdlib.h> diff --git a/openbsd/OpenBSDProcessTable.c b/openbsd/OpenBSDProcessTable.c index 0b016fbb..26c6c52b 100644 --- a/openbsd/OpenBSDProcessTable.c +++ b/openbsd/OpenBSDProcessTable.c @@ -6,6 +6,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "openbsd/OpenBSDProcessTable.h" #include <kvm.h> diff --git a/openbsd/Platform.c b/openbsd/Platform.c index b41900b0..a8b5d212 100644 --- a/openbsd/Platform.c +++ b/openbsd/Platform.c @@ -6,6 +6,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "openbsd/Platform.h" #include <errno.h> diff --git a/pcp/InDomTable.c b/pcp/InDomTable.c index 40a22f1d..68563fb9 100644 --- a/pcp/InDomTable.c +++ b/pcp/InDomTable.c @@ -6,6 +6,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "InDomTable.h" #include <assert.h> diff --git a/pcp/PCPDynamicScreen.c b/pcp/PCPDynamicScreen.c index a4622e34..a66d9dce 100644 --- a/pcp/PCPDynamicScreen.c +++ b/pcp/PCPDynamicScreen.c @@ -6,6 +6,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "pcp/PCPDynamicScreen.h" #include <ctype.h> diff --git a/pcp/PCPProcess.c b/pcp/PCPProcess.c index df18b6f2..2ea4e5c6 100644 --- a/pcp/PCPProcess.c +++ b/pcp/PCPProcess.c @@ -7,6 +7,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "pcp/PCPProcess.h" #include <math.h> diff --git a/solaris/Platform.c b/solaris/Platform.c index c4b121c7..5faa91ae 100644 --- a/solaris/Platform.c +++ b/solaris/Platform.c @@ -7,6 +7,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "solaris/Platform.h" #include <kstat.h> diff --git a/zfs/ZfsCompressedArcMeter.c b/zfs/ZfsCompressedArcMeter.c index 2e494736..4d47040c 100644 --- a/zfs/ZfsCompressedArcMeter.c +++ b/zfs/ZfsCompressedArcMeter.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "zfs/ZfsCompressedArcMeter.h" #include <stddef.h> |