Commit 100146d7 authored by Benjamin REIS's avatar Benjamin REIS

Use Target_OS_IPHONE

parent 5905dfac
......@@ -21,6 +21,9 @@
#ifndef ORTP_PORT_H
#define ORTP_PORT_H
#if __APPLE__
#include "TargetConditionals.h"
#endif
#if !defined(_WIN32) && !defined(_WIN32_WCE)
/********************************/
......@@ -385,7 +388,7 @@ ORTP_PUBLIC bool_t ortp_is_multicast_addr(const struct sockaddr *addr);
/*define __ios when we are compiling for ios.
The TARGET_OS_IPHONE macro is stupid, it is defined to 0 when compiling on mac os x.
*/
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE==1
#if TARGET_OS_IPHONE
#define __ios 1
#endif
......
......@@ -22,6 +22,10 @@
#define _GNU_SOURCE
#endif
#if __APPLE__
#include "TargetConditionals.h"
#endif
#ifdef HAVE_CONFIG_H
#include "ortp-config.h" /*needed for HAVE_SYS_UIO_H and HAVE_ARC4RANDOM */
#endif
......@@ -1665,7 +1669,7 @@ int rtp_session_rtp_recv (RtpSession * session, uint32_t user_ts) {
if (session->on_network_error.count>0){
rtp_signal_table_emit3(&session->on_network_error,"Error receiving RTP packet",ORTP_INT_TO_POINTER(getSocketErrorCode()));
}else ortp_warning("Error receiving RTP packet: %s, err num [%i],error [%i]",getSocketError(),errnum,error);
#ifdef __ios
#if TARGET_OS_IPHONE
/*hack for iOS and non-working socket because of background mode*/
if (errnum==ENOTCONN){
/*re-create new sockets */
......@@ -1728,7 +1732,7 @@ int rtp_session_rtcp_recv (RtpSession * session) {
if (session->on_network_error.count>0){
rtp_signal_table_emit3(&session->on_network_error,"Error receiving RTCP packet",ORTP_INT_TO_POINTER(getSocketErrorCode()));
}else ortp_warning("Error receiving RTCP packet: %s, err num [%i],error [%i]",getSocketError(),errnum,error);
#ifdef __ios
#if TARGET_OS_IPHONE
/*hack for iOS and non-working socket because of background mode*/
if (errnum==ENOTCONN){
/*re-create new sockets */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment