From 179aeb01082df9e7c19a285ae4d703a7714f4e2f Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Wed, 29 Nov 2023 17:44:20 +0100 Subject: Add includes for config.h as per the discussion in PR #1337 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- XUtils.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'XUtils.h') diff --git a/XUtils.h b/XUtils.h index afe22112..1babb86e 100644 --- a/XUtils.h +++ b/XUtils.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 #include -- cgit v1.2.3