If you want to use cpphs as a completely drop-in replacement for thereal cpp, that is, to accept the same arguments, and have broadlythe same behaviour in response to them, then use the --cpp compatibilityoption.

LICENCE-------These library modules are distributed under the terms of the LGPL.The application module 'cpphs.hs' is GPL.

This software comes with no warranty. Use at your own risk.

If you have a commercial use for cpphs, and feel the terms of the (L)GPLare too onerous, you have the option of distributing unmodified binaries(only, not sources) under the terms of a different licence (seeLICENCE-commercial).

WEBSITE-------http://projects.haskell.org/cpphs/darcs get http://code.haskell.org/~malcolm/cpphs

Version 1.11------------ * API change: runCpphs, cppIfdef, and macroPass are now in the IO monad.

Version 1.10----------- * New command-line option: "--linepragma" It converts #line droppings into {-# LINE #-}.

Version 1.9----------- * Bugfix for #undef.

Version 1.8----------- * Bugfix for off-by-one error in line numbers with --include=file.

Version 1.7----------- * Bugfix in interaction of --unlit with \end{code}

Version 1.6----------- * New command-line option: "--include=filename". * New command-line option: "--strip-eol" for comment-stripping. * Line pragmas can have filenames containing spaces.

Version 1.5----------- * Parametrised macro-calls now permitted in #ifdef's. * Recursive textual expansion now permitted in #ifdef's. * Better options-handling when used as a library. * Various small bugfixes

Version 1.4----------- * Added a "--pragma" option to retain #pragma in the output. * Fixed a number of obscure corner cases involving the interaction of multiple features e.g. foo##__LINE__. * Added the "--nowarn" option.

Version 1.3----------- * Added a "--cpp" option for drop-in compatibility with standard cpp. It causes cpphs to accept standard cpp flags and translate them to cpphs equivalents. Compatibility options include: -o, -ansi, -traditional, -stdc, -x, -include, -P, -C, -CC, -A. The file behaviour is different too - if two filenames are given on the commandline, then the second is treated as the output location. * Fixed a corner-case bug in evaluating chained and overlapping #ifdefs.

Version 1.1----------- * Fix the .cabal way of building cpphs. * Update the --version reported (forgotten in 1.0, which still reports 0.9) * No longer throws an error when given an empty file as input.

Version 1.0----------- * Add a compatibility script cpphs.compat, allowing cpphs to act as a drop-in replacement for cpp, e.g. ghc -cpp -pgmP cpphs.compat * Place quotes around replacements for special macros __FILE__, __DATE__, and __TIME__. * If no files are specified, read from stdin. * Ignore #! lines (e.g. in scripts) * Parse -D commandline options once only, and consistently with cpp, i.e. -Dfoo means foo=1 * Fix compatibility with preprocessors like hsc2hs, which use non-cpp directives like #def. They are now passed through to the output with a warning to stderr.

Version 0.8----------- * Added the --text option, to signify the input should not be lexed as Haskell. This causes macros to be defined or expanded regardless of their location within comments, string delimiters, etc. * Shuffle a few files around to make it easier to say 'hmake cpphs'. There is also now a runhugs script to invoke cpphs nicely.

Version 0.7----------- * Enable the __FILE__, __LINE__, __DATE__, and __TIME__ specials, which can be useful for creating DIY error messages.

Version 0.6----------- * Recognise and ignore the #pragma cpp directive. * Fix beginning-of-file bug, where in --noline mode, a # cpp directive at the top of the file appeared in the output. * Fix chained parenthesised boolean exprs in #if, e.g. #if ( foo ) && ( bar ) * Fix precedence in chained unparenthesised boolean exprs in #if, e.g. #if foo && bar || baz && frob * For better compatibility with cpp, and because otherwise there are certain constructs that cannot be expressed, we no longer permit whitespace in a <tt>#define</tt> between the symbolname and an opening parenthesis, e.g. #define f (f' id) Previously, this was interpreted as a parametrised macro, with arguments in the parens, and no expansion. Now, the space indicates that this is a textual replacement, and the parenthesised expression is in fact the replacement.

Version 0.5----------- * Added a --version flag to report the version number. * Renamed --stringise to --hashes, and use it to turn on ## catenation as well. * Bugfix for #if 1, previously taken as false. * Bugfix for --nolines: it no longer adds extra spurious newlines. * File inclusion now looks in the directory of the calling file. * Failure to find an include file is now merely a warning to stderr rather than an error. * Added a --layout flag. Previously, line continuations in a macro definition were always preserved in the output, permitting use of the Haskell layout rule even inside a macro. The default is now to remove line continuations for conformance with cpp, but the option of using --layout is still possible.