我使用了来自Determining 32 vs 64 bit in C++的答案来做这个:
#ifndef AVUNA_CFG
#define AVUNA_CFG
#if _WIN32 || _WIN64
#if _WIN64
#define BIT64
#else
#define BIT32
#endif
#endif
// Check GCC
#if __GNUC__
#if __x86_64__ || __ppc64__
#define BIT64
#else
#define BIT32
#endif
#endif
#endif但是,当指定-m32给GCC进行交叉编译时,这似乎不起作用,所以它总是说BIT64。有什么定义可以用于此目的吗?
发布于 2015-08-12 09:57:23
我最终使用了Eclipse-define,因为我对32/64位交叉编译有两种不同的运行配置。效果很好。
https://stackoverflow.com/questions/31954238
复制相似问题