Merge pull request #5 from dholm/feature/osx-support

endian: MacOS X support for endian conversion macros
This commit is contained in:
Piotr K. 2014-12-03 00:51:20 +01:00
commit bb69c799d5
4 changed files with 18 additions and 0 deletions

15
include/gsm/endian.h Normal file
View File

@ -0,0 +1,15 @@
#ifndef GSM_ENDIAN_H
#define GSM_ENDIAN_H
#if defined(__linux__)
# include <endian.h>
#elif defined(__APPLE__)
# include <libkern/OSByteOrder.h>
# define htobe16(x) OSSwapHostToBigInt16(x)
# define htobe32(x) OSSwapHostToBigInt32(x)
# define be32toh(x) OSSwapBigToHostInt32(x)
#endif
#endif /* GSM_ENDIAN_H */

View File

@ -25,6 +25,7 @@
#endif
#include <gnuradio/io_signature.h>
#include <gsm/endian.h>
#include <gsm/gsmtap.h>
#include "get_bcch_or_ccch_bursts_impl.h"

View File

@ -26,6 +26,7 @@
#include <gnuradio/io_signature.h>
#include "universal_ctrl_chans_demapper_impl.h"
#include <gsm/endian.h>
#include <gsm/gsmtap.h>
namespace gr {

View File

@ -39,6 +39,7 @@
#include <iostream>
#include <iomanip>
#include <boost/scoped_ptr.hpp>
#include <gsm/endian.h>
//files included for debuging
//#include "plotting/plotting.hpp"