From 04a28270893fb691ab69578fe96e0848af4aa907 Mon Sep 17 00:00:00 2001
From: Martine Lenders <m.lenders@fu-berlin.de>
Date: Wed, 14 Nov 2018 13:54:12 +0100
Subject: [PATCH] gnrc_icmpv6_error: provide NOPs when compiled without module

This is aimed to make the usage code of this module more readable.
---
 sys/include/net/gnrc/icmpv6/error.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sys/include/net/gnrc/icmpv6/error.h b/sys/include/net/gnrc/icmpv6/error.h
index 552c93be34..7bd527e131 100644
--- a/sys/include/net/gnrc/icmpv6/error.h
+++ b/sys/include/net/gnrc/icmpv6/error.h
@@ -33,6 +33,7 @@
 extern "C" {
 #endif
 
+#if defined(MODULE_GNRC_ICMPV6_ERROR) || defined(DOXYGEN)
 /**
  * @brief   Sends an ICMPv6 destination unreachable message for sending.
  *
@@ -78,6 +79,17 @@ void gnrc_icmpv6_error_time_exc_send(uint8_t code,
  */
 void gnrc_icmpv6_error_param_prob_send(uint8_t code, void *ptr,
                                        const gnrc_pktsnip_t *orig_pkt);
+#else   /* defined(MODULE_GNRC_ICMPV6_ERROR) || defined(DOXYGEN) */
+/* NOPs to make the usage code more readable */
+#define gnrc_icmpv6_error_dst_unr_send(code, orig_pkt) \
+        (void)code; (void)orig_pkt
+#define gnrc_icmpv6_error_pkt_too_big_send(mtu, orig_pkt) \
+        (void)mtu; (void)orig_pkt
+#define gnrc_icmpv6_error_time_exc_send(code, orig_pkt) \
+        (void)code; (void)orig_pkt
+#define gnrc_icmpv6_error_param_prob_send(code, ptr, orig_pkt) \
+        (void)code; (void)ptr, (void)orig_pkt
+#endif  /* defined(MODULE_GNRC_ICMPV6_ERROR) || defined(DOXYGEN) */
 
 #ifdef __cplusplus
 }
-- 
GitLab