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:
@@ -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. */
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#include "macro.h"
|
||||
#include "memory-util.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user