basic: Override glibc's sys/param.h header with an empty file

Instead of unconditionally including sys/param.h in
macro-fundamental.h which itself includes a bunch of other unnecessary
headers, let's override it with an empty file to avoid it from overriding
our MAX() macro. We can't make including it an error as it's included (
for seemingly no good reason) by <resolv.h>.
This commit is contained in:
Daan De Meyer
2025-05-09 11:23:14 +02:00
parent 8449d38d6f
commit 3b58245624
8 changed files with 15 additions and 22 deletions
+8
View File
@@ -0,0 +1,8 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
/* sys/param.h from glibc unconditionally overrides the MIN() and MAX() macros which interferes with our own
* MAX() macro. It also includes a bunch of other headers transitively so we don't want to include
* sys/param.h in macro-fundamental.h unconditionally. We'd like to make including this file an error but
* unfortunately <resolv.h> includes it. However, <resolv.h> doesn't actually make use of anything from
* sys/param.h, so we override it with an empty file so it can't mess with our macros. */
-1
View File
@@ -5,7 +5,6 @@
#include <errno.h>
#include <inttypes.h>
#include <stdbool.h>
#include <sys/param.h>
#include <sys/sysmacros.h>
#include <sys/types.h>
+2
View File
@@ -1,6 +1,8 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <signal.h>
#include "macro.h"
#include "memory-util.h"