Preprocessor

MHS comes with a fully featured 100% conformant preprocessor. This feature is not necessarily intended to assist in working with the target process. This feature is simply an extra that can help some people in any case when they may need a real preprocessor for any miscellaneous work they are doing. The Preprocessor is primarily used with the scripts, but it is provided here as a stand-alone tool to lend a hand when needed. Specifically, the Preprocessor may be helpful in adding macros to Java® projects, or for preprocessing header files for use with custom C/C++ parsers.

To access the Preprocessor, select the Tools/Preprocessor menu item.

 

Include Directories

These are the directories that will be searched when #include <…> directives are reached. The directories are scanned in the order in which they are listed. Use the Up and Down buttons to change the order of include directories.

Environment variables can be used in the paths. Press the Environment Variables button to add more if you need.

 

Predefined Macros

These are simple macros to be predefined before preprocessing begins. Macros must be valid identifiers and can not be function-like or variadic. If no value is specified, the macro is simply defined as #define MACRO, otherwise it is defined as #define MACRO VALUE.

You can allow the standard Windows® macros to be automatically included by checking the Auto-Include Windows Macros check.

The following lists the macros that are defined with this is checked:

Macro

Value

_CPPLIB_VER 405
_CPPRTTI  
_CRT_SECURE_NO_DEPRECATE  
_INTEGRAL_MAX_BITS

64

_M_IX86 600
_M_IX86_FP 0
_MSC_EXTENSIONS

1

_MSC_VER 1400
_MT  
_NATIVE_WCHAR_T_DEFINED  
_WCHAR_T_DEFINED

 

_WIN32  
_WINDOWS  
_Wp64  
WIN32  

 

Preprocess a File

This is where you can actually preprocess a file with the options above. An input and output file are required. If Retain Whitespace/Comments is checked, all whitespace and comments are included in the output file. Otherwise, all comments, blank lines, and preceding whitespace is stripped in the output file. If Emit #line Directives is checked, #line directives will be included in the output file in the format #line <line> "<file>".

Press the Go! button to begin preprocessing a file.

 

Support

This preprocessor is a Standard-conformant C++ preprocessor and accepts several Microsoft® extensions such as #pragma once.

Function-like macros are supported, as well as variadic macros (macros with a variable number of parameters). All macros are correctly expanded as per the Standard.

All standard preprocessor directives are supported.

 

The preprocessor is based off Wave.
Copyright © 2006 Shawn (L. Spiro) Wilcoxen