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

endian: MacOS X support for endian conversion macros
diff --git a/include/gsm/endian.h b/include/gsm/endian.h
new file mode 100644
index 0000000..c176a49
--- /dev/null
+++ b/include/gsm/endian.h
@@ -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 */
diff --git a/lib/demapping/get_bcch_or_ccch_bursts_impl.cc b/lib/demapping/get_bcch_or_ccch_bursts_impl.cc
index 76d3f10..875360e 100644
--- a/lib/demapping/get_bcch_or_ccch_bursts_impl.cc
+++ b/lib/demapping/get_bcch_or_ccch_bursts_impl.cc
@@ -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"
 
diff --git a/lib/demapping/universal_ctrl_chans_demapper_impl.cc b/lib/demapping/universal_ctrl_chans_demapper_impl.cc
index df4c2b5..325a59b 100644
--- a/lib/demapping/universal_ctrl_chans_demapper_impl.cc
+++ b/lib/demapping/universal_ctrl_chans_demapper_impl.cc
@@ -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 {
diff --git a/lib/receiver/receiver_impl.cc b/lib/receiver/receiver_impl.cc
index 08d8a07..378910d 100644
--- a/lib/receiver/receiver_impl.cc
+++ b/lib/receiver/receiver_impl.cc
@@ -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"