stdbool.h 在哪里? [英] Where is stdbool.h?

查看:32
本文介绍了stdbool.h 在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的系统上找到 _Bool 定义,因此对于缺少它的系统,我可以实现它.我在这里和其他网站上看到了它的各种定义,但想在系统上查看最终定义.

I want to find the _Bool definition on my system, so for systems where it's missing I can implement it. I've seen various definitions for it here and on other sites, but wanted to check on the system for the definitive definition.

小问题,我找不到 _Bool 的定义位置,甚至找不到 stdbool.h

Slight problem, in that I can't find where _Bool is defined or even stdbool.h

mussys@debmus:~$ find /usr/include/* -name stdbool.h
/usr/include/c++/4.3/tr1/stdbool.h

grep for _Bool on /usr/include/*/usr/include/*/* 也没找到.

And grep for _Bool on /usr/include/* and /usr/include/*/* does not find it either.

那么它在哪里?

推荐答案

_Bool 是内置类型,所以不要期望在头文件中找到它的定义,即使是系统头文件.

_Bool is a built-in type, so don't expect to find a definition for it in a header file, even a system header file.

话虽如此,从您正在搜索的路径中猜测您的系统,您是否查看过 /usr/lib/gcc/*/*/include ?

Having said that, guessing your system from the paths that you are searching, have you looked in /usr/lib/gcc/*/*/include ?

我的真实"stdbool.h 就住在那里.正如预期的那样,它的 #definebool_Bool.由于 _Bool 是编译器原生的类型,因此在头文件中没有定义.

My "real" stdbool.h lives there. As expected it #defines bool to be _Bool. As _Bool is a type native to the compiler there's no definition for it in the header file.

这篇关于stdbool.h 在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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