Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Hirrolot/awesome-c-preprocessor

A list of awesome C preprocessor stuff
https://github.com/Hirrolot/awesome-c-preprocessor

List: awesome-c-preprocessor

Last synced: 3 months ago
JSON representation

A list of awesome C preprocessor stuff

Awesome Lists containing this project

README

        

# awesome-c-preprocessor

> A list of awesome C preprocessor stuff

See also: [_"The Preprocessor Iceberg Meme"_](https://jadlevesque.github.io/PPMP-Iceberg/).

## Metaprogramming frameworks

- [Hirrolot/metalang99](https://github.com/Hirrolot/metalang99) -- Full-blown preprocessor metaprogramming.
- [boostorg/preprocessor](https://github.com/boostorg/preprocessor) -- Boost.org preprocessor module.
- [boostorg/vmd](https://github.com/boostorg/vmd) -- Boost.org VMD module.
- [rofl0r/order-pp](https://github.com/rofl0r/order-pp) -- order-pp preprocessor library (standalone part of chaos-pp).
- [rofl0r/chaos-pp](https://github.com/rofl0r/chaos-pp) -- chaos preprocessor library. this is what boost preprocessor derived from.
- [pfultz2/Cloak](https://github.com/pfultz2/Cloak) -- A mini-preprocessor library to demonstrate the recursive capabilities of the preprocessor.
- [pfultz2/ZLang](https://github.com/pfultz2/ZLang) -- A plugin framework for namespace macros in C/C++.
- [mcinglis/libpp](https://github.com/mcinglis/libpp) -- Functional-programming macros for the C preprocessor.
- [mcinglis/macrofun](https://github.com/mcinglis/macrofun) -- Standards-defying functional-programming macros for the C preprocessor.
- [gustedt/p99](https://gitlab.inria.fr/gustedt/p99/) -- Macros and functions for C99.
- [davidgarland/ceano](https://github.com/davidgarland/ceano) -- A collection of C preprocessor hackery.
- [twhitehead/c99-meta](https://github.com/twhitehead/c99-meta) -- Abusing the C99 preprocessor for meta-programming.
- [metacall/core/source/preprocessor](https://github.com/metacall/core/tree/develop/source/preprocessor) -- Preprocessor Library by Parra Studios.

## C language extensions

- [Hirrolot/datatype99](https://github.com/Hirrolot/datatype99) -- Algebraic data types for C99.
- [Hirrolot/interface99](https://github.com/Hirrolot/interface99) -- Zero-boilerplate interfaces for C99.
- [orangeduck/Cello](https://github.com/orangeduck/Cello) -- Higher level programming in C.
- [CObjectSystem/COS](https://github.com/CObjectSystem/COS) -- C Object System: a framework that brings C to the level of other high level programming languages and beyond.
- [small-c/obj.h](https://github.com/small-c/obj.h) -- A single-header supports OOP in pure C.
- [shakna-israel/LetsDestroyC.md](https://gist.github.com/shakna-israel/4fd31ee469274aa49f8f9793c3e71163#file-letsdestroyc-md) -- Let's Destroy C.
- [yulon/clofn](https://github.com/yulon/clofn) -- A closure function implementation for C.
- [alexanderchuranov/Metaresc](https://github.com/alexanderchuranov/Metaresc) -- META data and RESource library for C language.
- [Leushenko/C99-Lambda](https://github.com/Leushenko/C99-Lambda) -- Purely evil preprocessor macros adding anonymous functions and closures to ISO C99.
- [Leushenko/Pyrite](https://github.com/Leushenko/Pyrite) -- BASIC-style "compiler" as C syntax library.
- [emdash/goof](https://github.com/emdash/goof) -- A toy functional language created through the abuse of C.
- [Qqwy/c_exceptional](https://github.com/Qqwy/c_exceptional) -- A simple Exception-handling library for C99.

## Compilers/Interpreters

- [BlueFlo0d/CSP](https://github.com/BlueFlo0d/CSP) -- Compile-time LISP interpreter on C macro preprocessor.
- [cospplredman/PPLISP](https://github.com/cospplredman/PPLISP) -- A set of 45 macros that allow for lisp-like preprocessor meta programming.
- [Ferdi265/preprocessor_brainfuck](https://github.com/Ferdi265/preprocessor_brainfuck) -- A brainfuck interpreter using only the C preprocessor.
- [orangeduck/CPP_COMPLETE](https://github.com/orangeduck/CPP_COMPLETE) -- Brainfuck interpreter written in the C preprocessor.
- [mkotha/bfi](https://github.com/mkotha/bfi) -- A brainfuck interpreter on the C preprocessor.
- [notfoundry/bf.h](https://gist.github.com/notfoundry/fad611951bbcec68d72be4fa093537a8#file-bf-h) -- Brainfuck interpreter written in the C preprocessor.
- [notfoundry/ppasm](https://github.com/notfoundry/ppasm) -- x86_64 macro assembler entirely in C preprocessor.

## Debuggers

- [ptaffet/preprocessor-debug](https://github.com/ptaffet/preprocessor-debug) -- Observe how the C preprocessor expands your complicated macros.
- [notfoundry/ppstep](https://github.com/notfoundry/ppstep) -- Interactive C/C++ preprocessor macro debugger.
- [messer-cpp/messer](https://github.com/messer-cpp/messer) -- REPL for C preprocessor of C++17.

## Other projects

- [mcpp](https://mcpp.sourceforge.net/) -- A portable C preprocessor.
- [swansontec/map-macro](https://github.com/swansontec/map-macro) -- A recursive C preprocessor macro which performs an operation on each element of a list.
- [M4GNV5/CppFun](https://github.com/M4GNV5/CppFun) -- Math in the C pre-processor by breaking up Numbers into arrays of 8 bits and implementing common operations on those arrays.
- [ramdeoshubham/macros](https://github.com/ramdeoshubham/macros) -- A collection of commonly used C MACROS.
- [agrif/Makefile](https://gist.github.com/agrif/6127126) -- A horrible, horrible, wonderful C Preprocessor hack library.
- [notfoundry/wtf.c](https://gist.github.com/notfoundry/aa927a9ef07a3a5990b08c5e78b0b492) -- 4-bit ALU metaprogrammed in C11's \_Generic.
- [kcning/binom](https://github.com/kcning/binom) -- C macro that computes binominal coefficient at compile time.
- [ldionne/cisp](https://github.com/ldionne/cisp) -- A C preprocessor library implementing object semantics.
- [rofl0r/thread_wrapper](https://github.com/rofl0r/thread_wrapper) -- A thread launcher wrapper macro which removes the boilerplate and allows to call any non-void function as a separate thread (needs BOOST preprocessor lib, which is C compatible).
- [18sg/uSHET](https://github.com/18sg/uSHET/blob/c09e0acafd86720efe42dc15c63e0cc228244c32/lib/cpp_magic.h) -- A Malloc-Free SHET Client Library for Microcontrollers (`lib/cpp_magic.h`).
- [ScrimpyCat/CommonC](https://github.com/ScrimpyCat/CommonC/blob/30983aa36b2e4e17ade1d0ad60ba7b27ccf16bad/CommonC/Template.h) -- Common utilities for C (`CommonC/Template.h`).
- [cher-nov/Gena](https://github.com/cher-nov/Gena) -- Generic pseudo-templated containers for C. Written entirely in C89 with design inspired by the C++ STL.
- [DiscordPP/discordpp](https://github.com/DiscordPP/discordpp) and [DiscordPP/plugin-native](https://github.com/DiscordPP/plugin-native) -- A modular Discord library and a module for it that use macros to define Discord API endpoints and objects.

## Articles

- [_7 Scandalous Weird Old Things About The C Preprocessor_](https://blog.robertelder.org/7-weird-old-things-about-the-c-preprocessor/) by Robert Elder.
- [_Coroutines in C_](https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html) by Simon Tatham.
- [_IOCC "Best abuse of the C preprocessor"_](http://www.ioccc.org/2001/herrmann1.hint) by Immanuel Herrmann.
- [_Metaprogramming custom control structures in C_](https://www.chiark.greenend.org.uk/~sgtatham/mp/) by Simon Tatham.
- [_Advanced metaprogramming in C_](https://250bpm.com/blog:56/) by Martin Sústrik.
- [_C/C++ Preprocessor Metaprogramming_](http://saadahmad.ca/cc-preprocessor-metaprogramming-2/) by Saad Ahmad.
- [_The Love/Hate Relationship with the C Preprocessor: An Interview Study_](https://www.cs.cmu.edu/~ckaestne/pdf/ecoop15.pdf) by Flávio Medeiros, Christian Kästner, Márcio Ribeiro, Sarah Nadi, Rohit Gheyi.
- [_Outperforming LAPACK with C metaprogramming_](https://wordsandbuttons.online/outperforming_lapack_with_c_metaprogramming.html) by Oleksandr Kaleniuk.
- [_C Pre-Processor Magic_](http://jhnet.co.uk/articles/cpp_magic) by Jonathan Heathcote.

### Jens Gustedt's Blog

Link: https://gustedt.wordpress.com/category/c99/preprocessor/.

Some worth-noting articles:

- [_Handling control flow inside macros_](https://gustedt.wordpress.com/2011/02/02/handling-control-flow-inside-macros/)
- [_Scope Bound Resource Management with `for` Scopes_](https://gustedt.wordpress.com/2010/08/14/scope-bound-resource-management-with-for-scopes/)
- [_Detect empty macro arguments_](https://gustedt.wordpress.com/2010/06/08/detect-empty-macro-arguments/)
- [_Default arguments for C99_](https://gustedt.wordpress.com/2010/06/03/default-arguments-for-c99/)

## SO questions

- [_Is the C99 preprocessor Turing complete?_](https://stackoverflow.com/questions/3136686/is-the-c99-preprocessor-turing-complete)
- [_Can we have recursive macros?_](https://stackoverflow.com/questions/12447557/can-we-have-recursive-macros)
- [_Overloading Macro on Number of Arguments_](https://stackoverflow.com/questions/11761703/overloading-macro-on-number-of-arguments)
- [_The most useful user-made C-macros (in GCC, also C99)?_](https://stackoverflow.com/questions/1772119/the-most-useful-user-made-c-macros-in-gcc-also-c99)
- [_Understanding DEFER and OBSTRUCT macros_](https://stackoverflow.com/questions/29962560/understanding-defer-and-obstruct-macros)