__WORDSIZE在编译中的作用 [英] Role of __WORDSIZE in compilation

查看:2242
本文介绍了__WORDSIZE在编译中的作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是/usr/include/x86_64-linux-gnu/gnu/stubs-32.h文件的内容:

Below are the contents of /usr/include/x86_64-linux-gnu/gnu/stubs-32.h file:

#include <bits/wordsize.h>    
#if __WORDSIZE == 32
# include <gnu/stubs-32.h>
#elif __WORDSIZE == 64
# include <gnu/stubs-64.h>
#else
# error "unexpected value for __WORDSIZE macro"
#endif

我在64位计算机上,所以

I am on 64 Bit machine, so the result of

#include<stdio.h>
main()
{
printf("Word size : %d\n",__WORDSIZE);
}

Word size : 64

这是一个问题,系统变量__WORDSIZE的作用是什么? 我正在开发32位应用程序(使用mingw 32位编译器),由于__WORDSIZE是64位,因此文件/usr/include/x86_64-linux-gnu/gnu/stubs-32.h最终导致包含/usr/include/x86_64-linux-gnu/gnu/stubs-64.h.我对这部分感到困惑.此操作的后果是什么?这是正常现象吗?如果没有,我该如何强行加入/usr/include/x86_64-linux-gnu/gnu/stubs-32.h?

So here is the question, what is the role of the system variable __WORDSIZE? I am developing a 32 bit application( using mingw 32 bit compiler) and since my __WORDSIZE is 64 bit, the file /usr/include/x86_64-linux-gnu/gnu/stubs-32.h ultimately results in including /usr/include/x86_64-linux-gnu/gnu/stubs-64.h. I am confused about this part. What are the consequences of this action? Is this normal and if not how can I forcibly include /usr/include/x86_64-linux-gnu/gnu/stubs-32.h?

先谢谢您.

推荐答案

这是一个清单常量,供编译器实现排他内部使用;它的名称带有两个下划线作为前缀,这清楚地表明它不打算在用户空间中使用.

It is a manifest constant, intended for internal use by the compiler implementation exclusively; that its name is prefixed by two underscores is a clear indicator that it is not intended for use in user space.

这篇关于__WORDSIZE在编译中的作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆