dmpp is a small, fast, standalone C preprocessor. It reads source files in C or C++, and generates a preprocessed output file. It is implemented in the D programming language.
| Option | Description |
|---|---|
| filename... | source file name(s) |
| -D name[(args)][=value] | define macro name |
| --dep filename | generate dependencies to output file |
| -I path | path to #include files |
| --isystem path | path to system #include files |
| -o filename | preprocessed output file |
| -v | verbose |
If the output file is not specified:
And the source file has an extension of .c, it will
be named after the source file with the extension replaced with .i.
Else if the source file has an extension of .cpp, .cxx, or .hpp,
the output file will be the source file with the extension replaced with .ii.
Else the output file will be the source file with .ii appended.
-
Will process multiple source files at the same time. This increases speed because the contents of
#includefiles are cached. -
If output files are not specified, a default file name is generated from the source file name with the extension replaced with
.i -
The only predefined macros are
__BASE_FILE__,__FILE__,__LINE__,__COUNTER__,__TIMESTAMP__,__DATE__, and__TIME__. Any others desired should be set via the command line. -
-v uses the following codes for
#includefiles:
| Code | Description |
|---|---|
S |
system file |
| ' ' | normal file read |
C |
file read from cached copy |
O |
file skipped because of #pragma once |
G |
file skipped because of #include guard |
- supports
#pragma once - supports
#pragma GCC system_header - supports linemarker output
- supports
,##__VA_ARGS__extension which elides the comma __COUNTER____BASE_FILE__predefined macros
- trigraphs not supported
- digraphs not supported
- \u or \U in identifiers not supported
- C++ alternate keywords not supported
- multibyte Japanese, Chinese, or Korean characters not supported in source code
- Unicode (UTF8) not supported in source code
Copyright © 2021 by Digital Mars