The mission of Wondermacros is to bring in features of modern programming languages to C through macros. C macros in general are not recommended for a reason. Most of the issues can be avoided by writting macros using strict guidelines but the biggest issue remains; programs having macros may be hard to debug and maintain. The good news is that there exists methods to overcome many of these issues but they require specific expertices. So a word of warning is in place.
Wondermacros is for C11 standard at the moment. Most of the macros are fully functional with C99 as well.
An alphabetical macro reference is here.
Wondermacros aims to provide full programming platform toolkit including
- Object-Oriented Programming Toolkit
 - Generic Data Structures
- Deque
 - Dynamic array
 - Dynamic stack
 - Hash table
 - Singly-linked list
 - Doubly-linked list
 - Singly-linked circular list
 
 - Unit testing framework
 - Exception framework
 - Various X-macros to expand code from compact specifications in consistent manner
 - Iterative generic tree traversal macros: for_each_preorder and for_each_postorder
 - Generic array manipulation: get_size (for statically allocated arrays), for_each, for_each_reversed, move_left, and move_right
 - Pointer macros
 - Sorting macros
 - Metaprogramming macros for writting macros: loop building macros and various others
 - Pre-processor mathematic macros
 - Pre-processor string (character sequence) macros
 
We try not to reinvent the wheel and build on top of Boost pre-processor library. So Boost must be installed. Boost in general is a C++ framework but the pre-processor library is just for pre-processor. Nothing in it is C++ specific.
We will also incorporate some great macros of others. For instance, some macros build on Simon Tatham's metaprogramming macros which provide a general purpose toolkit for building looping macros and other useful control structures.
Best Regards, J.P. Iivonen wondermacros@yahoo.com
- v0.0.2 (Jul 20 2021): Adds pre-processor combination and permutation tools.
- Add W_PP_FOR_EACH_COMBINATION
 - Add W_PP_FOR_EACH_PERMUTATION
 
 - v0.0.1 (Jul 18 2021): Adds pre-processor sorting and various other tools.
- Add W_SEQ_SWAP, W_SEQ_SORT, W_SEQ_MIN, W_SEQ_MAX and W_SEQ_MEDIAN
 - W_PP_MIN and W_PP_MAX and take up to six arguments (originally just two)
 - Add W_PP_SORT and W_PP_MEDIAN
 - Add W_PP_EVEN and W_PP_ODD
 
 - v0.0.0 (Jun 2 2019): Initial version.
 
- Wrest - A Generic Dynamic Loading Based REST Server
 - Web Elements - HTML & CSS Generation and String Template System in C
 - Wfsm - A UML State Machine in C
 
The package contains just header files. To install wondermacros directory under /usr/include, type 'make install' as root.
See some examples under examples directory. To build them, first install Wondermacros using 'make install' as root. Then type 'make'. This will also build the regression test suite (see the next chapter).
To run regression tests, go to under main level directory test and type make to compile. The regression tests are written directly to the macro files. To run all tests type ./test/wondermacros after building the test set.