Pregunta

Does anybody know a library similar to boost::preprocessor (maybe not so advanced) that could be easily used/incorporated in plain C projects? Of course, the most (all ?) of boost::preprocessor is usable when writing in C but I would prefer a small library with only basic capabilities that doesn't depend on the monster like boost.

¿Fue útil?

Solución

I suggest you use Boost.Preprocessor. Don't think i haven't read your question entirely. I suggest you use Boost.Preprocessor alone, not the whole boost package. In order to do that, you can use a small utility called bcp which lets you extract the libraries that you need, in your case Boost.Preprocessor.

Otros consejos

You can always extract components out of boost using bcp, though, to be honest, i haven't tested that with Boost.Preprocessor yet.
I think you will have a hard time to find other implementations that are as portable as boosts.

P99 (http://p99.gforge.inria.fr/) comes to mind.

Quote:

P99 is a suite of macro and function definitions that ease the programming in modern C, aka > C99. By using new tools from C99 we implement default arguments for functions, scope bound > resource management, transparent allocation and initialization, ...

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top