Two new command line options are added to allow the file to be preprocessed by
the C-Preprocessor by invoking the C preprocessor. BEFORE you can use this
option you must add two values to the following registry key:
| |
HKEY_LOCAL_MACHINE\SOFTWARE/Distinct/Dlls\RPC32 Cpconst
D CpDelim "/"
|
The first of these sets the compiler definitions option to D and the second sets
the argument delimeter to /. If your compiler uses different values set these
here.
By default, preprocessing will not be invoked. To invoke preprocessing follow
these steps below:
To invoke the C-preprocessor use the following syntax when running
rpcgen32:
| |
rpcgen32 -p "compiler arguments" [-D
name=value] where: -p invokes the
preprocessor "arguments" are the set of arguments required by
your compiler -D is optional and is used to specify specific
compiler definitions.
|
When do you need to use C-Preprocessing?
Your files will require C-Preprocessing when they contain #if, #else, #ifdef,
#ifndef, #if defined etc. If the files contain these definitions please use the
C-Preprocessor option.
Example
If you are using cl.exe (Microsoft's Visual C++ compiler) the
argument should be
-p "cl.exe /EP /nologo" file.x.
The existing command line options can be used in conjunction with -p
option.
If you are using a c-preprocessor other than cl.exe please enter
the argument list as needed. The argument list should be able to send the
processed file to the stdout and should only contain information for rcpgen32 to
do further processing. That is, the output must not contain any banner or text
issued by the compiler. For Microsoft C++ the /nologo option will inhibit these.
Warning
The program creates a temporary file having the name of the .x file but with
a .i extension. If a file with the same name exists, its contents will be
overwritten. The file will be created in the directory where the output files
are generated. This file will be cleaned up before the program exits.