net: echo_client: Avoid using #ifdef and #ifndef

It is prefered to use #if (!)defined form for checking defines since it
can actually check more complex conditions.

Change-Id: Ib8779a344a1a7ec02f10b0e23a533c78e68343b5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2016-02-22 12:55:23 +02:00 committed by Gerrit Code Review
commit fb568ac6a9

View file

@ -58,7 +58,7 @@ static const char *lorem_ipsum =
static int expecting;
static int ipsum_len;
#ifdef CONFIG_NETWORKING_IPV6_NO_ND
#if defined(CONFIG_NETWORKING_IPV6_NO_ND)
/* The peer is the server in our case. Just invent a mac
* address for it because lower parts of the stack cannot set it
* in this test as we do not have any radios.
@ -68,7 +68,7 @@ static uint8_t peer_mac[] = { 0x0a, 0xbe, 0xef, 0x15, 0xf0, 0x0d };
static uint8_t my_mac[] = { 0x15, 0x0a, 0xbe, 0xef, 0xf0, 0x0d };
#ifdef CONFIG_NETWORKING_WITH_IPV6
#if defined(CONFIG_NETWORKING_WITH_IPV6)
#if 0
/* The 2001:db8::/32 is the private address space for documentation RFC 3849 */
#define PEER_IPADDR { { { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x1 } } }
@ -109,7 +109,7 @@ static inline void init_app(void)
net_set_mac(my_mac, sizeof(my_mac));
#ifdef CONFIG_NETWORKING_WITH_IPV4
#if defined(CONFIG_NETWORKING_WITH_IPV4)
{
uip_ipaddr_t addr;
uip_ipaddr(&addr, 192,0,2,2);
@ -117,7 +117,7 @@ static inline void init_app(void)
}
#endif
#ifdef CONFIG_NETWORKING_IPV6_NO_ND
#if defined(CONFIG_NETWORKING_IPV6_NO_ND)
{
uip_ipaddr_t *addr;
@ -250,7 +250,7 @@ static inline bool get_context(struct net_context **unicast,
static struct net_addr any_addr;
static struct net_addr my_addr;
#ifdef CONFIG_NETWORKING_WITH_IPV6
#if defined(CONFIG_NETWORKING_WITH_IPV6)
static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
static const struct in6_addr in6addr_mcast = MCAST_IPADDR;
@ -305,7 +305,7 @@ static inline bool get_context(struct net_context **unicast,
return true;
}
#ifdef CONFIG_NANOKERNEL
#if defined(CONFIG_NANOKERNEL)
#define STACKSIZE 2000
static char __noinit __stack stack_receiving[STACKSIZE];
#endif
@ -376,7 +376,7 @@ void main(void)
return;
}
#ifdef CONFIG_MICROKERNEL
#if defined(CONFIG_MICROKERNEL)
receiving();
#else
task_fiber_start(&stack_receiving[0], STACKSIZE,