diff --git a/cpu/native/include/clang_compat.h b/cpu/native/include/clang_compat.h new file mode 100644 index 0000000000..0a92e60bec --- /dev/null +++ b/cpu/native/include/clang_compat.h @@ -0,0 +1,20 @@ +/* + * clang_compat.h Undefines macros of clang on OSX to use RIOT's macros + * + * Copyright (C) 2014 Thomas Eichinger + * + * 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 diff --git a/sys/net/include/net_help.h b/sys/net/include/net_help.h index 03d890b711..25cc78c069 100644 --- a/sys/net/include/net_help.h +++ b/sys/net/include/net_help.h @@ -15,6 +15,10 @@ #include #include +#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) | \ diff --git a/sys/net/include/sixlowpan/ip.h b/sys/net/include/sixlowpan/ip.h index aaf41c44ac..a6782aa395 100644 --- a/sys/net/include/sixlowpan/ip.h +++ b/sys/net/include/sixlowpan/ip.h @@ -25,8 +25,8 @@ #include #include "inet_ntop.h" -#include "net_help.h" #include "net_if.h" +#include "net_help.h" #include "sixlowpan/types.h" /** diff --git a/sys/net/link_layer/net_if/net_if.c b/sys/net/link_layer/net_if/net_if.c index 4ded2494a5..533bb095d0 100644 --- a/sys/net/link_layer/net_if/net_if.c +++ b/sys/net/link_layer/net_if/net_if.c @@ -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 diff --git a/sys/net/network_layer/sixlowpan/ip.c b/sys/net/network_layer/sixlowpan/ip.c index 5ef2b6761c..1c7d6928af 100644 --- a/sys/net/network_layer/sixlowpan/ip.c +++ b/sys/net/network_layer/sixlowpan/ip.c @@ -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"