iphone 移植时碰到到问题 一: invalid type int * to socklen_t *

在移植过程中, 碰到 类型转换非法
getsockopt/setsockopt

 

在windows linux 下都是ok的, 可是ios 移植时,却提出错误。


改为:

int len = sizeof(...);

getsockopt(...., (socklen_t *)(&len)); 

 

则ok。

 

不知socklen_t 定义的是什么类型, 有时间再查。
姑且记下, 以备忘。 

你可能感兴趣的:(iphone 移植时碰到到问题 一: invalid type int * to socklen_t *)