有没有办法在Android NDK上使用__int128_t?

问题描述 投票:4回答:1

有没有办法在Android NDK上使用__int128_t?

我尝试使用GNU工具链4.9,但无论我如何尝试,我都会收到以下错误:error: '__int128_t' was not declared in this scope

-std=gnu++11当然是启用的。

android-ndk g++ int128
1个回答
1
投票

有没有办法在Android NDK上使用__int128_t?

我不相信。 __int128_t是模拟的,它仅在64位平台上可用。目前它尚未在Android上提供,这是一个32位平台。见Is __int128_t arithmetic emulated by GCC, even with SSE?

您可以通过检测宏__int128_t的存在来检查__SIZEOF_INT128__的可用性。如果定义了宏并且值为16或更大,则可以使用128位类型。另请参阅GCC邮件列表中的128-bit integer - nonsensical documentation?

© www.soinside.com 2019 - 2024. All rights reserved.