diff --git a/cpu/native/include/clang_compat.h b/cpu/native/include/clang_compat.h new file mode 100644 index 0000000000000000000000000000000000000000..0a92e60bec574ba4e5a51fa5c268ee9488b0fd9b --- /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 <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 diff --git a/sys/net/include/net_help.h b/sys/net/include/net_help.h index 03d890b711b33169d49f90a3a06970c472ef8ccd..25cc78c0692fedffecb6f6ac900a4ede30b2896d 100644 --- a/sys/net/include/net_help.h +++ b/sys/net/include/net_help.h @@ -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) | \ diff --git a/sys/net/include/sixlowpan/ip.h b/sys/net/include/sixlowpan/ip.h index aaf41c44ac863630728b46651fb9e6c5cf6612b0..a6782aa3955c2ed19a036774ce1781596187706a 100644 --- a/sys/net/include/sixlowpan/ip.h +++ b/sys/net/include/sixlowpan/ip.h @@ -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" /** diff --git a/sys/net/link_layer/net_if/net_if.c b/sys/net/link_layer/net_if/net_if.c index 4ded2494a5e91bf836f86bec9c9da1c0c9eee696..533bb095d09784c9c987bc4a96dff0577beb9e54 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 5ef2b6761cb10f20a61cce2a9d706af56b42a3df..1c7d6928afdbe938677f6185aaf0e7d905a4ae56 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"