misc: Attempt to determine byte order in a cross-platform way
OSX does not provide an endian.h, use the other header files that should define/include what we need. Also check that the byteorder define is available.
This commit is contained in:
parent
88a5fa0a75
commit
3cb287919e
|
@ -25,7 +25,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <endian.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
@ -40,6 +39,15 @@
|
||||||
|
|
||||||
#warning "Make use of the rtp proxy code"
|
#warning "Make use of the rtp proxy code"
|
||||||
|
|
||||||
|
/* attempt to determine byte order */
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
|
#ifndef __BYTE_ORDER
|
||||||
|
#error "__BYTE_ORDER should be defined by someone"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* according to rtp_proxy.c RFC 3550 */
|
/* according to rtp_proxy.c RFC 3550 */
|
||||||
struct rtp_hdr {
|
struct rtp_hdr {
|
||||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <endian.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
@ -37,6 +36,15 @@
|
||||||
#include <openbsc/debug.h>
|
#include <openbsc/debug.h>
|
||||||
#include <openbsc/rtp_proxy.h>
|
#include <openbsc/rtp_proxy.h>
|
||||||
|
|
||||||
|
/* attempt to determine byte order */
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
|
#ifndef __BYTE_ORDER
|
||||||
|
#error "__BYTE_ORDER should be defined by someone"
|
||||||
|
#endif
|
||||||
|
|
||||||
static LLIST_HEAD(rtp_sockets);
|
static LLIST_HEAD(rtp_sockets);
|
||||||
|
|
||||||
/* should we mangle the CNAME inside SDES of RTCP packets? We disable
|
/* should we mangle the CNAME inside SDES of RTCP packets? We disable
|
||||||
|
|
Loading…
Reference in New Issue