Sandworm is an embeddable preprocessor based on clang. Created to compile ubershaders, but can preprocess anything you like.
Compiles and runs on MSVC 2015 but in theory can be used on any platform that supports clang.
The clang preprocessor supports expression evaluation and integer arithmetic, so it is much more powerful than the default preprocessor for HLSL.
See Example for usage example.