[pjsip] iOS/MacOS PJSip socklen_t conflict with socket.h

转载自:http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2010-November/012121.html

socketcc 集成到 xcode 项目中的时候,

出现了 socklen_t  redefinition 的错误,解决办法如下:

Hi all, I noticed theres a redefinition conflict between socklen_t in

pjlib/include/pj/compat/os_darwin.h    (defined as int)

and between the base OS socket.h (defined as __darwin_socklen_t - which is __uint32_t)

The diff below fixes it and/or you could redefine it as typedef __darwin_socklen_t socklen_t;

Index: os_darwinos.h
===================================================================
--- os_darwinos.h	(revision 3362)
+++ os_darwinos.h	(working copy)
@@ -95,7 +95,10 @@
 /*
  * Socket related
  */
+#ifndef _SOCKLEN_T
+#define _SOCKLEN_T
 typedef int socklen_t;
+#endif
 
 /* Set 1 if native sockaddr_in has sin_len member. 
  * Default: 0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值