1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #1173 from thomaseichinger/fix_rpl_udp_osx

native: net: OSX: Fix rpl_udp example
This commit is contained in:
Thomas Eichinger 2014-05-15 08:05:07 +02:00
commit 16638d1760
6 changed files with 32 additions and 9 deletions

View File

@ -0,0 +1,20 @@
/*
* 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

View File

@ -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) | \

View File

@ -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"
/**

View File

@ -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

View File

@ -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"

View File

@ -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;
}