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:
Thomas Eichinger 2014-05-14 16:06:58 +02:00
parent 46acc2f5d5
commit 7a031e5669
5 changed files with 26 additions and 3 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"