gpt4 book ai didi

android - 如何发现我为 iOS 编译

转载 作者:太空宇宙 更新时间:2023-11-04 03:39:52 27 4
gpt4 key购买 nike

我有一些为 iOS、Android 和 MS-Windows 编译的 C 代码,需要包含 malloc.h。现在我的问题是在 iOS 上包含的是 malloc/malloc.h

所以我需要这样的东西:

#if defined (…)
# include <malloc/malloc.h>
#else
# include <malloc.h>
#endif

在……的地方放什么?

PS:是的,我用谷歌搜索了它,但我没有找到正确的关键字。一个 LMGTFY 会被找到,所以我知道我应该用谷歌搜索什么。

最佳答案

你可以使用下面的定义

#if defined(__APPLE__)
# include <malloc/malloc.h>
#else
# include <malloc.h>
#endif

关于android - 如何发现我为 iOS 编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29537742/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com