现今所有64位的类Unix平台均使用LP64数据模型,而64位Windows使用LLP64数据模型。
Datatype | LP64 | ILP64 | LLP64 | ILP32 | LP32 |
---|---|---|---|---|---|
char | 8 | 8 | 8 | 8 | 8 |
short | 16 | 16 | 16 | 16 | 16 |
int | 32 | 64 | 32 | 32 | 16 |
long | 64 | 64 | 32 | 32 | 32 |
long long | 64 | 64 | 64 | 64 | 64 |
pointer | 64 | 64 | 64 | 32 | 32 |
所以,在 Linux 中做 Windows 的交叉编译时,需要注意 MinGW 是 LLP64,long 就是 32 位。
网友评论