⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 system-specific-predefined-macros.html

📁 gcc手册
💻 HTML
字号:
<html lang="en">

<head>

<title>The C Preprocessor</title>

<meta http-equiv="Content-Type" content="text/html">

<meta name="description" content="The C Preprocessor">

<meta name="generator" content="makeinfo 4.3">

<link href="http://www.gnu.org/software/texinfo/" rel="generator-home">

<!--

Copyright &copy; 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,

1997, 1998, 1999, 2000, 2001, 2002, 2003

Free Software Foundation, Inc.



   <p>Permission is granted to copy, distribute and/or modify this document

under the terms of the GNU Free Documentation License, Version 1.1 or

any later version published by the Free Software Foundation.  A copy of

the license is included in the

section entitled "GNU Free Documentation License".



   <p>This manual contains no Invariant Sections.  The Front-Cover Texts are

(a) (see below), and the Back-Cover Texts are (b) (see below).



   <p>(a) The FSF's Front-Cover Text is:



   <p>A GNU Manual



   <p>(b) The FSF's Back-Cover Text is:



   <p>You have freedom to copy and modify this GNU Manual, like GNU

     software.  Copies published by the Free Software Foundation raise

     funds for GNU development. 

-->

</head>

<body>

<div class="node">

<p>

Node:<a name="System-specific%20Predefined%20Macros">System-specific Predefined Macros</a>,

Next:<a rel="next" accesskey="n" href="C---Named-Operators.html#C++%20Named%20Operators">C++ Named Operators</a>,

Previous:<a rel="previous" accesskey="p" href="Common-Predefined-Macros.html#Common%20Predefined%20Macros">Common Predefined Macros</a>,

Up:<a rel="up" accesskey="u" href="Predefined-Macros.html#Predefined%20Macros">Predefined Macros</a>

<hr><br>

</div>



<h4 class="subsection">System-specific Predefined Macros</h4>



   <p>The C preprocessor normally predefines several macros that indicate what

type of system and machine is in use.  They are obviously different on

each target supported by GCC.  This manual, being for all systems and

machines, cannot tell you what their names are, but you can use

<code>cpp -dM</code> to see them all.  See <a href="Invocation.html#Invocation">Invocation</a>.  All system-specific

predefined macros expand to the constant 1, so you can test them with

either <code>#ifdef</code> or <code>#if</code>.



   <p>The C standard requires that all system-specific macros be part of the

<dfn>reserved namespace</dfn>.  All names which begin with two underscores,

or an underscore and a capital letter, are reserved for the compiler and

library to use as they wish.  However, historically system-specific

macros have had names with no special prefix; for instance, it is common

to find <code>unix</code> defined on Unix systems.  For all such macros, GCC

provides a parallel macro with two underscores added at the beginning

and the end.  If <code>unix</code> is defined, <code>__unix__</code> will be defined

too.  There will never be more than two underscores; the parallel of

<code>_mips</code> is <code>__mips__</code>.



   <p>When the <code>-ansi</code> option, or any <code>-std</code> option that

requests strict conformance, is given to the compiler, all the

system-specific predefined macros outside the reserved namespace are

suppressed.  The parallel macros, inside the reserved namespace, remain

defined.



   <p>We are slowly phasing out all predefined macros which are outside the

reserved namespace.  You should never use them in new programs, and we

encourage you to correct older code to use the parallel macros whenever

you find it.  We don't recommend you use the system-specific macros that

are in the reserved namespace, either.  It is better in the long run to

check specifically for features you need, using a tool such as

<code>autoconf</code>.



   </body></html>



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -