Linux内核中大小端判定宏

时间:2015-07-21 10:20:36   收藏:0   阅读:305
#include <stdio.h>

static union{ char c[4];unsigned long mylong;} endian_test = { {l,?,?,b} };
#define ENDIANNESS  ( (char) endian_test.mylong )

int main()
{
        printf("%c",ENDIANNESS);
}

略显简洁

原文:http://www.cnblogs.com/wanliyun/p/4663577.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!