net: handle macro redefinitions for OS X
undefine macros and reorder header includes to get rid of system defined macros on OS X fixes #1165
This commit is contained in:
parent
46acc2f5d5
commit
7a031e5669
20
cpu/native/include/clang_compat.h
Normal file
20
cpu/native/include/clang_compat.h
Normal 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
|
||||
@ -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"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user