确定在预处理器中从64位交叉编译32位的时间?

时间:2015-08-12 00:39:04

标签: c++ c-preprocessor

我使用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

但是,在为GCC指定-m32进行交叉编译时,这似乎不起作用,所以它总是说BIT64。我可以为此目的使用任何定义吗?

1 个答案:

答案 0 :(得分:0)

我最终使用了Eclipse-define,因为我有两种不同的运行配置用于32/64位交叉编译。效果很好。

相关问题