A fast preprocessor for C and C++
D Makefile Other
Latest commit 56e99cb Nov 3, 2015 @caabernathy caabernathy Update README.md
Part of archival process.
Permalink
Failed to load latest commit information.
tests Work with .S files Mar 29, 2015
LICENSE Initializing Mar 28, 2014
Makefile add character classification table May 30, 2014
README.md Update README.md Nov 3, 2015
charclass.d convert switch to fast table lookup Apr 1, 2015
cmdline.d convert switch to fast table lookup Apr 1, 2015
constexpr.d convert switch to fast table lookup Apr 1, 2015
context.d fix #29 with the same trick as pathsx Apr 1, 2015
defines_clang3_2.d Initializing Mar 28, 2014
defines_clang3_4.d Initializing Mar 28, 2014
defines_clangdev.d Initializing Mar 28, 2014
defines_clangxx3_2.d Initializing Mar 28, 2014
defines_clangxx3_4.d Initializing Mar 28, 2014
defines_clangxxdev.d Initializing Mar 28, 2014
defines_gcc4_7_1.d Initializing Mar 28, 2014
defines_gcc4_8_1.d Initializing Mar 28, 2014
defines_gxx4_7_1.d Initializing Mar 28, 2014
defines_gxx4_8_1.d Initializing Mar 28, 2014
directive.d convert switch to fast table lookup Apr 1, 2015
expanded.d convert switch to fast table lookup Apr 1, 2015
file.d added magic comments to warp sources to set up indentation in Emacs Mar 29, 2015
id.d convert switch to fast table lookup Apr 1, 2015
lexer.d convert switch to fast table lookup Apr 1, 2015
loc.d added magic comments to warp sources to set up indentation in Emacs Mar 29, 2015
macros.d convert switch to fast table lookup Apr 1, 2015
main.d convert switch to fast table lookup Apr 1, 2015
number.d convert switch to fast table lookup Apr 1, 2015
outdeps.d added magic comments to warp sources to set up indentation in Emacs Mar 29, 2015
ranges.d convert switch to fast table lookup Apr 1, 2015
run_tests.sh
skip.d convert switch to fast table lookup Apr 1, 2015
sources.d convert switch to fast table lookup Apr 1, 2015
stringlit.d convert switch to fast table lookup Apr 1, 2015
textbuf.d added magic comments to warp sources to set up indentation in Emacs Mar 29, 2015
util.d convert switch to fast table lookup Apr 1, 2015
warpdrive.d added magic comments to warp sources to set up indentation in Emacs Mar 29, 2015

README.md


This project is not actively maintained. Proceed at your own risk!


warp: Facebook's C and C++ Preprocessor

warp is an open-source preprocessor for the C and C++ programming languages. We use it at Facebook as a faster replacement of cpp, GNU's preprocessor.

The companion program warpdrive drives warp in conjunction with the predefined macros of a few of today's crop of compilers (gcc 4.7.1, gcc 4.8.1, clang 3.2, and clang 3.4).

Currently warp's build has only been tested with gcc 4.7.1 and gcc 4.8.1 on CentOS 6. More officially supported platforms to follow.

Dependencies

You need a D compiler installation, which can be downloaded from here. For maximum speed we recommend using the gdc compiler.

Building and using warp

warp by itself is agnostic of the C or C++ dialect implemented by a particular compiler. It is common for compilers to implicitly define a number of macros that affect the precompilation process. To help with that, warp is accompanied by warpdrive, a simple driver program that invokes warp with the appropriate #defines for a few popular compilers.

To build warp, use the simple Makefile that's part of the distribution:

make -j

This will produce warp (the core program) and also the drivers warpdrive_gcc4_7_1, warpdrive_gcc4_8_1, warpdrive_clang3_2, warpdrive_clang3_4, and warpdrive_clangdev, each packaged for the respective compiler and version.

To invoke warp, simply use

warpdrive <flags> filename

In all likelihood you'll need to use -I for adding paths to included library files (warpdrive doesn't bake those in.)