【发布时间】:2016-05-23 08:15:15
【问题描述】:
我下载了glibc 的几个版本,即2.18、2.19、2.20、2.23,我试图找到文件iso646.h,但找不到。我认为它是 glibc 的标准部分,所以它应该在那里。有谁知道它为什么不存在?
但是,我在我的本地计算机上的 /usr/lib/gcc 目录中找到了它。所以我假设它是用 gcc 安装的。但我仍然不知道为什么我在 glibc 源中找不到它。我正在粘贴我在下面找到的内容:
/* Copyright (C) 1997-2014 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
/*
* ISO C Standard: 7.9 Alternative spellings <iso646.h>
*/
#ifndef _ISO646_H
#define _ISO646_H
#ifndef __cplusplus
#define and &&
#define and_eq &=
#define bitand &
#define bitor |
#define compl ~
#define not !
#define not_eq !=
#define or ||
#define or_eq |=
#define xor ^
#define xor_eq ^=
#endif
#endif
编辑: 我在下载的每个 glibc 源(来自 gnu.org)中找到的唯一文件(有点类似于 iso646.h)是 conform/data /iso646.h-data 如下所示:
#if !defined ISO && !defined POSIX && !defined XPG3 && !defined XPG4
macro and
macro and_eq
macro bitand
macro bitor
macro compl
macro not
macro not_eq
macro or
macro or_eq
macro xor
macro xor_eq
#if !defined ISO && !defined ISO99 && !defined ISO11
allow *_t
#endif
#endif
但由于我不知道这里如何定义macro,也不知道它是在哪里定义的,所以这个文件对我来说是不可理解的。
【问题讨论】:
-
你检查过路径glibc/conform/data/iso646.h-data
-
@piyushjaiswal 是的,在我提出问题之前,我实际上查看了 glibc/conform/data/iso646.h 文件,但因为我不知道
macro是如何定义的,或者在什么文件中macro被定义在,我无法理解该文件并且没有费心将它包含在问题中。请参阅我添加到问题中的编辑部分。