• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/toolchains/hndtools-armeabi-2011.09/share/doc/arm-arm-none-eabi/html/cpp/
1<html lang="en">
2<head>
3<title>System-specific Predefined Macros - The C Preprocessor</title>
4<meta http-equiv="Content-Type" content="text/html">
5<meta name="description" content="The C Preprocessor">
6<meta name="generator" content="makeinfo 4.13">
7<link title="Top" rel="start" href="index.html#Top">
8<link rel="up" href="Predefined-Macros.html#Predefined-Macros" title="Predefined Macros">
9<link rel="prev" href="Common-Predefined-Macros.html#Common-Predefined-Macros" title="Common Predefined Macros">
10<link rel="next" href="C_002b_002b-Named-Operators.html#C_002b_002b-Named-Operators" title="C++ Named Operators">
11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
12<!--
13Copyright (C) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
141997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
152008, 2009, 2010, 2011
16Free Software Foundation, Inc.
17
18Permission is granted to copy, distribute and/or modify this document
19under the terms of the GNU Free Documentation License, Version 1.3 or
20any later version published by the Free Software Foundation.  A copy of
21the license is included in the
22section entitled ``GNU Free Documentation License''.
23
24This manual contains no Invariant Sections.  The Front-Cover Texts are
25(a) (see below), and the Back-Cover Texts are (b) (see below).
26
27(a) The FSF's Front-Cover Text is:
28
29     A GNU Manual
30
31(b) The FSF's Back-Cover Text is:
32
33     You have freedom to copy and modify this GNU Manual, like GNU
34     software.  Copies published by the Free Software Foundation raise
35     funds for GNU development.
36-->
37<meta http-equiv="Content-Style-Type" content="text/css">
38<style type="text/css"><!--
39  pre.display { font-family:inherit }
40  pre.format  { font-family:inherit }
41  pre.smalldisplay { font-family:inherit; font-size:smaller }
42  pre.smallformat  { font-family:inherit; font-size:smaller }
43  pre.smallexample { font-size:smaller }
44  pre.smalllisp    { font-size:smaller }
45  span.sc    { font-variant:small-caps }
46  span.roman { font-family:serif; font-weight:normal; } 
47  span.sansserif { font-family:sans-serif; font-weight:normal; } 
48--></style>
49<link rel="stylesheet" type="text/css" href="../cs.css">
50</head>
51<body>
52<div class="node">
53<a name="System-specific-Predefined-Macros"></a>
54<a name="System_002dspecific-Predefined-Macros"></a>
55<p>
56Next:&nbsp;<a rel="next" accesskey="n" href="C_002b_002b-Named-Operators.html#C_002b_002b-Named-Operators">C++ Named Operators</a>,
57Previous:&nbsp;<a rel="previous" accesskey="p" href="Common-Predefined-Macros.html#Common-Predefined-Macros">Common Predefined Macros</a>,
58Up:&nbsp;<a rel="up" accesskey="u" href="Predefined-Macros.html#Predefined-Macros">Predefined Macros</a>
59<hr>
60</div>
61
62<h4 class="subsection">3.7.3 System-specific Predefined Macros</h4>
63
64<p><a name="index-system_002dspecific-predefined-macros-62"></a><a name="index-predefined-macros_002c-system_002dspecific-63"></a><a name="index-reserved-namespace-64"></a>
65The C preprocessor normally predefines several macros that indicate what
66type of system and machine is in use.  They are obviously different on
67each target supported by GCC.  This manual, being for all systems and
68machines, cannot tell you what their names are, but you can use
69<samp><span class="command">cpp -dM</span></samp> to see them all.  See <a href="Invocation.html#Invocation">Invocation</a>.  All system-specific
70predefined macros expand to the constant 1, so you can test them with
71either &lsquo;<samp><span class="samp">#ifdef</span></samp>&rsquo; or &lsquo;<samp><span class="samp">#if</span></samp>&rsquo;.
72
73   <p>The C standard requires that all system-specific macros be part of the
74<dfn>reserved namespace</dfn>.  All names which begin with two underscores,
75or an underscore and a capital letter, are reserved for the compiler and
76library to use as they wish.  However, historically system-specific
77macros have had names with no special prefix; for instance, it is common
78to find <code>unix</code> defined on Unix systems.  For all such macros, GCC
79provides a parallel macro with two underscores added at the beginning
80and the end.  If <code>unix</code> is defined, <code>__unix__</code> will be defined
81too.  There will never be more than two underscores; the parallel of
82<code>_mips</code> is <code>__mips__</code>.
83
84   <p>When the <samp><span class="option">-ansi</span></samp> option, or any <samp><span class="option">-std</span></samp> option that
85requests strict conformance, is given to the compiler, all the
86system-specific predefined macros outside the reserved namespace are
87suppressed.  The parallel macros, inside the reserved namespace, remain
88defined.
89
90   <p>We are slowly phasing out all predefined macros which are outside the
91reserved namespace.  You should never use them in new programs, and we
92encourage you to correct older code to use the parallel macros whenever
93you find it.  We don't recommend you use the system-specific macros that
94are in the reserved namespace, either.  It is better in the long run to
95check specifically for features you need, using a tool such as
96<samp><span class="command">autoconf</span></samp>.
97
98   </body></html>
99
100