检测目标体系结构endianess(在预处理器时间内) [英] Detect target architecture endianess (in preprocessor time)
本文介绍了检测目标体系结构endianess(在预处理器时间内)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好。我想写一些multiplataform / architecure代码。在* nix世界中存在一些#defines(BYTE_ORDER通常由sys / types.h包含)。 Windows世界中存在类似的内容吗?
Hi everyone. I want to write some multiplataform/architecure code. In the *nix world there exists some #defines (BYTE_ORDER generally defined by sys/types.h inclusion). There exists something like this in the Windows world?
提前致谢。
祝你好运
推荐答案
您可以使用类似
You can use something like
#define IS_BIG_ENDIAN (*(WORD *)"\0\x2" == 0x200)
这篇关于检测目标体系结构endianess(在预处理器时间内)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文