문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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, ...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top