Repository navigation
Expand file tree
/
Copy pathifdef.1
More file actions
58 lines (58 loc) · 1.36 KB
/
Copy pathifdef.1
File metadata and controls
58 lines (58 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<
73D4
div data-line-number="23" class="react-line-number react-code-text" style="padding-right:16px">2324
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.TH IFDEF 1
.SH NAME
ifdef \- remove #ifdefs from a file
.SH SYNOPSIS
\fBifdef \fR[\fB\-t\fR] [\fB\-d\fIsymbol\fR] [\fB\-D\fIsymbol\fR] [\fB\-U\fIsymbol\fR] [\fB\-I\fIsymbol\fR] [file]\fR
.br
.de FL
.TP
\\fB\\$1\\fR
\\$2
..
.de EX
.TP 20
\\fB\\$1\\fR
# \\$2
..
.SH OPTIONS
.TP 5
.B \-D
# Define symbol permanently
.TP 5
.B \-I
# Ignore symbol
.TP 5
.B \-U
# Undefine symbol permanently
.TP 5
.B \-d
# Define symbol. It may be #undef'ed later
.TP 5
.B \-t
# Produce a table of the symbols on \fIstdout\fR
.SH EXAMPLES
.TP 20
.B ifdef \-DUNIX file.c >newfile.c
# Define \fIUNIX\fR
.TP 20
.B ifdef \-D_MINIX \-UDOS <x.c >y.c
# Define \fI_MINIX\fR, undefine \fIDOS\fR
.SH DESCRIPTION
.PP
\fIIfdef\fR
allows conditional code [ #ifdef ... #endif ]
to be selectively removed from C files, but at the same time leaving
all other C preprocessor commands intact such as #define, #include etc.
Input to
.I ifdef
is either the file named as the last argument, or \fIstdin\fR if no file
is named.
Output goes to \fIstdout\fR.
.PP
Symbols may be defined with the \fB\-d\fR or \fB\-D\fR flags just like
\fIcpp\fR, except that the latter option ignores subsequent \fI#undefs\fR.
It is not permitted to give values to symbols.
Similarly, \fB\-U\fR undefines a symbol and ignores subsequent
\fI#defines\fRs.
Symbols defined with \fB\-I\fR are ignored; any \fI#ifdef\fR using an
ignored symbol will be left intact.