From c50da167bc8a70f18edc786591131e77bcfd8468 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 22 Dec 2020 16:47:51 +0100 Subject: [PATCH] all: adjust imports to fix libc/linux headers Linux headers and some libc headers have overlapping defines for network types and functions. In the past years, glibc and linux headers were improved to cooperate so you could include either one, in any order. With musl and possibly some older glibc versions that doesn't work so well. Reorder and change includes to make it work better. Yes, this looks pretty random and unmotivated. The includes are changed in order to successfully build on various libc/kernel versions, with the goal of not using #if. --- src/devices/nm-device.c | 5 +++-- src/devices/tests/test-lldp.c | 1 + src/platform/nm-linux-platform.c | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 2341ffe52..cd2101a52 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -8,7 +8,6 @@ #include "nm-device.h" -#include #include #include #include @@ -16,8 +15,10 @@ #include #include #include +#include +#include +#include #include -#include #include #include #include diff --git a/src/devices/tests/test-lldp.c b/src/devices/tests/test-lldp.c index 5c912b7d2..6da4a7697 100644 --- a/src/devices/tests/test-lldp.c +++ b/src/devices/tests/test-lldp.c @@ -6,6 +6,7 @@ #include "nm-default.h" #include +#include #include #include #include diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 28e6df1c6..505cf82cb 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -12,9 +12,10 @@ #include #include #include +#include #include #include -#include +#include #include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include #include #include