今天我遇到了麻烦 - android 的 ndk 没有 SUN_LEN 宏(sys/un.h || linux/un.h ),我不想修补 android 的 header ,该怎么办?
最佳答案
不要修补 header ,在您自己的文件中定义它。
#ifndef SUN_LEN //In case they fix it down the road
#define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) + strlen((ptr)->sun_path))
#endif
关于Android NDK 没有 SUN_LEN 宏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12627382/