From 9d6a32b551cb40fbb5bd3f967b42d56797c8038c Mon Sep 17 00:00:00 2001
From: Martine Lenders <mail@martine-lenders.eu>
Date: Thu, 29 Nov 2018 10:29:59 +0100
Subject: [PATCH] gnrc_mac: fix header includes

The inclusion of `net/gnrc.h` in `net/gnrc/mac/types.h` header makes it
impossible to include the `net/gnrc/netif.h` header within
`net/gnrc/netif/hdr.h`, due to `net/gnrc/mac/types.h` being included
with `net/gnrc/netif/mac.h` (which is included in `net/gnrc/netif.h`)
---
 sys/include/net/gnrc/gomach/types.h                            | 1 -
 sys/include/net/gnrc/mac/types.h                               | 2 +-
 sys/net/gnrc/link_layer/lwmac/lwmac.c                          | 1 +
 .../tests-gnrc_mac_internal/tests-gnrc_mac_internal.c          | 3 ++-
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/sys/include/net/gnrc/gomach/types.h b/sys/include/net/gnrc/gomach/types.h
index 8a0f0114d4..4f20bd45f7 100644
--- a/sys/include/net/gnrc/gomach/types.h
+++ b/sys/include/net/gnrc/gomach/types.h
@@ -24,7 +24,6 @@
 
 #include "kernel_types.h"
 #include "xtimer.h"
-#include "net/gnrc.h"
 #include "net/gnrc/gomach/hdr.h"
 
 #ifdef __cplusplus
diff --git a/sys/include/net/gnrc/mac/types.h b/sys/include/net/gnrc/mac/types.h
index c69b301436..0f77810770 100644
--- a/sys/include/net/gnrc/mac/types.h
+++ b/sys/include/net/gnrc/mac/types.h
@@ -25,7 +25,7 @@
 #include <stdbool.h>
 
 #include "kernel_types.h"
-#include "net/gnrc.h"
+#include "net/gnrc/pkt.h"
 #include "net/gnrc/priority_pktqueue.h"
 #include "net/ieee802154.h"
 #include "net/gnrc/mac/mac.h"
diff --git a/sys/net/gnrc/link_layer/lwmac/lwmac.c b/sys/net/gnrc/link_layer/lwmac/lwmac.c
index 402e207799..646a059827 100644
--- a/sys/net/gnrc/link_layer/lwmac/lwmac.c
+++ b/sys/net/gnrc/link_layer/lwmac/lwmac.c
@@ -29,6 +29,7 @@
 #include "random.h"
 #include "periph/rtt.h"
 #include "net/gnrc/netif.h"
+#include "net/gnrc/netif/hdr.h"
 #include "net/gnrc/netif/internal.h"
 #include "net/gnrc/netif/ieee802154.h"
 #include "net/netdev/ieee802154.h"
diff --git a/tests/unittests/tests-gnrc_mac_internal/tests-gnrc_mac_internal.c b/tests/unittests/tests-gnrc_mac_internal/tests-gnrc_mac_internal.c
index 31cc5870f0..12edf0f796 100644
--- a/tests/unittests/tests-gnrc_mac_internal/tests-gnrc_mac_internal.c
+++ b/tests/unittests/tests-gnrc_mac_internal/tests-gnrc_mac_internal.c
@@ -15,7 +15,8 @@
 
 #include "embUnit.h"
 
-#include "net/gnrc/pkt.h"
+#include "net/gnrc/pktbuf.h"
+#include "net/gnrc/netif/hdr.h"
 #include "net/gnrc/mac/internal.h"
 
 #include "unittests-constants.h"
-- 
GitLab