Skip to content
Snippets Groups Projects
Commit 16638d17 authored by Thomas Eichinger's avatar Thomas Eichinger
Browse files

Merge pull request #1173 from thomaseichinger/fix_rpl_udp_osx

native: net: OSX: Fix rpl_udp example
parents 47373a9e 7a031e56
No related branches found
No related tags found
No related merge requests found
/*
* clang_compat.h Undefines macros of clang on OSX to use RIOT's macros
*
* Copyright (C) 2014 Thomas Eichinger <thomas.eichinger@fu-berlin.de>
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License. See the file LICENSE in the top level directory for more
* details.
*/
#ifndef __CLANG_COMPAT_H
#undef HTONS
#undef HTONL
#undef HTONLL
#undef NTOHS
#undef NTOHL
#undef NTOHLL
#endif
......@@ -15,6 +15,10 @@
#include <string.h>
#include <stdint.h>
#if defined(__MACH__)
#include "clang_compat.h"
#endif
#define BITSET(var,pos) ((var) & (1<<(pos)))
#define HTONS(a) ((((uint16_t) (a) >> 8) & 0xff) | ((((uint16_t) (a)) & 0xff) << 8))
#define HTONL(a) ((((uint32_t) (a) & 0xff000000) >> 24) | \
......
......@@ -25,8 +25,8 @@
#include <stdint.h>
#include "inet_ntop.h"
#include "net_help.h"
#include "net_if.h"
#include "net_help.h"
#include "sixlowpan/types.h"
/**
......
......@@ -18,10 +18,10 @@
#include "ieee802154_frame.h"
#include "msg.h"
#include "mutex.h"
#include "net_help.h"
#include "transceiver.h"
#include "net_if.h"
#include "net_help.h"
#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
......
......@@ -25,7 +25,6 @@
#include "vtimer.h"
#include "mutex.h"
#include "msg.h"
#include "net_help.h"
#include "net_if.h"
#include "sixlowpan/mac.h"
......
......@@ -53,7 +53,7 @@ int _net_if_ifconfig_ipv6_addr_convert(net_if_addr_t *addr, void *addr_data,
char *addr_data_len);
void _net_if_ifconfig_list(int if_id);
int isnumber(char *str)
int is_number(char *str)
{
for (; *str; str++) {
if (!isdigit((int)*str)) {
......@@ -156,7 +156,7 @@ void _net_if_ifconfig(int argc, char **argv)
_net_if_ifconfig_create(argv[2]);
return;
}
else if (isnumber(argv[1])) {
else if (is_number(argv[1])) {
int if_id = atoi(argv[1]);
if (argc < 3) {
......@@ -227,7 +227,7 @@ void _net_if_ifconfig_set_hwaddr(int if_id, char *addr_str)
return;
}
if (isnumber(addr_str)) {
if (is_number(addr_str)) {
if ((addr = atoi(addr_str)) > 0xffff) {
set_usage();
return;
......@@ -252,7 +252,7 @@ void _net_if_ifconfig_set_pan_id(int if_id, char *pan_str)
return;
}
if (isnumber(pan_str)) {
if (is_number(pan_str)) {
if ((pan_id = atoi(pan_str)) > 0xffff) {
set_usage();
return;
......@@ -277,7 +277,7 @@ void _net_if_ifconfig_set_channel(int if_id, char *chan_str)
return;
}
if (isnumber(chan_str)) {
if (is_number(chan_str)) {
if ((channel = atoi(chan_str)) > 0xffff) {
set_usage();
return;
......@@ -504,7 +504,7 @@ int _net_if_ifconfig_ipv6_addr_convert(net_if_addr_t *addr, void *addr_data,
char *type, char *addr_data_str,
char *addr_data_len)
{
if (addr_data_len && !isnumber(addr_data_len)) {
if (addr_data_len && !is_number(addr_data_len)) {
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment