{"id":22857,"url":"https://github.com/Hirrolot/awesome-c-preprocessor","name":"awesome-c-preprocessor","description":"A list of awesome C preprocessor stuff","projects_count":67,"last_synced_at":"2026-08-14T19:00:20.354Z","repository":{"id":45916240,"uuid":"329785094","full_name":"hirrolot/awesome-c-preprocessor","owner":"hirrolot","description":"A list of awesome C preprocessor stuff","archived":false,"fork":false,"pushed_at":"2025-07-17T10:18:20.000Z","size":69,"stargazers_count":406,"open_issues_count":2,"forks_count":14,"subscribers_count":12,"default_branch":"master","last_synced_at":"2026-07-26T09:05:40.551Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hirrolot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-01-15T02:11:41.000Z","updated_at":"2026-07-11T22:32:42.000Z","dependencies_parsed_at":"2022-09-05T18:21:08.125Z","dependency_job_id":"5a409581-7ff9-4432-ad14-d25896d7fb9f","html_url":"https://github.com/hirrolot/awesome-c-preprocessor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hirrolot/awesome-c-preprocessor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirrolot%2Fawesome-c-preprocessor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirrolot%2Fawesome-c-preprocessor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirrolot%2Fawesome-c-preprocessor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirrolot%2Fawesome-c-preprocessor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hirrolot","download_url":"https://codeload.github.com/hirrolot/awesome-c-preprocessor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirrolot%2Fawesome-c-preprocessor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36662084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-06T04:43:03.162Z","status":"online","status_checked_at":"2026-08-14T02:00:06.934Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"created_at":"2024-01-13T12:56:24.872Z","updated_at":"2026-08-14T19:00:20.355Z","primary_language":"C","list_of_lists":false,"displayable":true,"categories":["Articles","Other projects","Metaprogramming frameworks","C language extensions","Compilers/Interpreters","SO questions","Debuggers"],"sub_categories":["[Jens Gustedt's Blog](https://gustedt.wordpress.com/category/c99/preprocessor/)"],"readme":"# `awesome-c-preprocessor`\n\n\u003e A list of awesome C preprocessor stuff\n\n\u003cimg src=\"meme.jpeg\" width=\"400px\"\u003e\n\nSee also: [_\"The Preprocessor Iceberg Meme\"_](https://jadlevesque.github.io/PPMP-Iceberg/).\n\n## Metaprogramming frameworks\n\n - [`hirrolot/metalang99`](https://github.com/hirrolot/metalang99) -- Full-blown preprocessor metaprogramming.\n - [`boostorg/preprocessor`](https://github.com/boostorg/preprocessor) -- Boost.org preprocessor module.\n - [`boostorg/vmd`](https://github.com/boostorg/vmd) -- Boost.org VMD module.\n - [`rofl0r/order-pp`](https://github.com/rofl0r/order-pp) -- order-pp preprocessor library (standalone part of chaos-pp).\n - [`rofl0r/chaos-pp`](https://github.com/rofl0r/chaos-pp) -- chaos preprocessor library. this is what boost preprocessor derived from.\n - [`pfultz2/Cloak`](https://github.com/pfultz2/Cloak) -- A mini-preprocessor library to demonstrate the recursive capabilities of the preprocessor.\n - [`pfultz2/ZLang`](https://github.com/pfultz2/ZLang) -- A plugin framework for namespace macros in C/C++.\n - [`mcinglis/libpp`](https://github.com/mcinglis/libpp) -- Functional-programming macros for the C preprocessor.\n - [`mcinglis/macrofun`](https://github.com/mcinglis/macrofun) -- Standards-defying functional-programming macros for the C preprocessor.\n - [`gustedt/p99`](https://gitlab.inria.fr/gustedt/p99/) -- Macros and functions for C99.\n - [`twhitehead/c99-meta`](https://github.com/twhitehead/c99-meta) -- Abusing the C99 preprocessor for meta-programming.\n - [`metacall/core/source/preprocessor`](https://github.com/metacall/core/tree/develop/source/preprocessor) -- Preprocessor Library by Parra Studios.\n\n## C language extensions\n\n - [`hirrolot/datatype99`](https://github.com/hirrolot/datatype99) -- Algebraic data types for C99.\n - [`hirrolot/interface99`](https://github.com/hirrolot/interface99) -- Zero-boilerplate interfaces for C99.\n - [`orangeduck/Cello`](https://github.com/orangeduck/Cello) -- Higher level programming in C.\n - [`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.\n - [`small-c/obj.h`](https://github.com/small-c/obj.h) -- A single-header supports OOP in pure C.\n - [`shakna-israel/LetsDestroyC.md`](https://gist.github.com/shakna-israel/4fd31ee469274aa49f8f9793c3e71163#file-letsdestroyc-md) -- Let's Destroy C.\n - [`yulon/clofn`](https://github.com/yulon/clofn) -- A closure function implementation for C.\n - [`alexanderchuranov/Metaresc`](https://github.com/alexanderchuranov/Metaresc) -- META data and RESource library for C language.\n - [`Leushenko/C99-Lambda`](https://github.com/Leushenko/C99-Lambda) -- Purely evil preprocessor macros adding anonymous functions and closures to ISO C99.\n - [`Leushenko/Pyrite`](https://github.com/Leushenko/Pyrite) -- BASIC-style \"compiler\" as C syntax library.\n - [`emdash/goof`](https://github.com/emdash/goof) -- A toy functional language created through the abuse of C.\n - [`Qqwy/c_exceptional`](https://github.com/Qqwy/c_exceptional) -- A simple Exception-handling library for C99.\n\n## Compilers/Interpreters\n\n - [`BlueFlo0d/CSP`](https://github.com/BlueFlo0d/CSP) --  Compile-time LISP interpreter on C macro preprocessor.\n - [`cospplredman/PPLISP`](https://github.com/cospplredman/PPLISP) -- A set of 45 macros that allow for lisp-like preprocessor meta programming.\n - [`Ferdi265/preprocessor_brainfuck`](https://github.com/Ferdi265/preprocessor_brainfuck) -- A brainfuck interpreter using only the C preprocessor.\n - [`orangeduck/CPP_COMPLETE`](https://github.com/orangeduck/CPP_COMPLETE) -- Brainfuck interpreter written in the C preprocessor.\n - [`mkotha/bfi`](https://github.com/mkotha/bfi) -- A brainfuck interpreter on the C preprocessor.\n - [`notfoundry/bf.h`](https://gist.github.com/notfoundry/fad611951bbcec68d72be4fa093537a8#file-bf-h) -- Brainfuck interpreter written in the C preprocessor.\n - [`notfoundry/ppasm`](https://github.com/notfoundry/ppasm) -- x86_64 macro assembler entirely in C preprocessor.\n\n## Debuggers\n\n - [`ptaffet/preprocessor-debug`](https://github.com/ptaffet/preprocessor-debug) -- Observe how the C preprocessor expands your complicated macros.\n - [`notfoundry/ppstep`](https://github.com/notfoundry/ppstep) -- Interactive C/C++ preprocessor macro debugger.\n - [`messer-cpp/messer`](https://github.com/messer-cpp/messer) -- REPL for C preprocessor of C++17.\n\n## Other projects\n\n - [`mcpp`](https://mcpp.sourceforge.net/) -- A portable C preprocessor.\n - [`Cedro`](https://sentido-labs.com/en/library/cedro/202106171400/) -- A C language extension that works as an (external) preprocessor.\n - [`eudoxia0/cmacro`](https://github.com/eudoxia0/cmacro) -- Lisp macros for C.\n - [`eudoxia0/magma`](https://github.com/eudoxia0/magma) -- A collection of useful macros based on `cmacro`.\n - [`swansontec/map-macro`](https://github.com/swansontec/map-macro) -- A recursive C preprocessor macro which performs an operation on each element of a list.\n - [`M4GNV5/CppFun`](https://github.com/M4GNV5/CppFun) -- Arithmetic in the C preprocessor by representing numbers as arrays of 8-bit elements.\n - [`ramdeoshubham/macros`](https://github.com/ramdeoshubham/macros) -- A collection of commonly used C MACROS.\n - [`cher-nov/Gena`](https://github.com/cher-nov/Gena) -- Generic pseudo-templated containers written in C89, inspired by C++ STL.\n - [`agrif/Makefile`](https://gist.github.com/agrif/6127126) -- A horrible, horrible, wonderful C Preprocessor hack library.\n - [`notfoundry/wtf.c`](https://gist.github.com/notfoundry/aa927a9ef07a3a5990b08c5e78b0b492) -- 4-bit ALU metaprogrammed in C11's `_Generic`.\n - [`kcning/binom`](https://github.com/kcning/binom) -- C macro that computes binominal coefficient at compile time.\n - [`ldionne/cisp`](https://github.com/ldionne/cisp) -- A C preprocessor library implementing object semantics.\n - [`rofl0r/thread_wrapper`](https://github.com/rofl0r/thread_wrapper) -- A thread launcher wrapper macro based on Boost/Preprocessor.\n - [`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`).\n - [`ScrimpyCat/CommonC`](https://github.com/ScrimpyCat/CommonC/blob/30983aa36b2e4e17ade1d0ad60ba7b27ccf16bad/CommonC/Template.h) -- Common utilities for C (`CommonC/Template.h`).\n\n## Articles\n\n - [_7 Scandalous Weird Old Things About The C Preprocessor_](https://blog.robertelder.org/7-weird-old-things-about-the-c-preprocessor/) by Robert Elder.\n - [_Coroutines in C_](https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html) by Simon Tatham.\n - [_IOCC \"Best abuse of the C preprocessor\"_](http://www.ioccc.org/2001/herrmann1.hint) by Immanuel Herrmann.\n - [_Metaprogramming custom control structures in C_](https://www.chiark.greenend.org.uk/~sgtatham/mp/) by Simon Tatham.\n - [_Advanced metaprogramming in C_](https://250bpm.com/blog:56/) by Martin Sústrik.\n - [_C/C++ Preprocessor Metaprogramming_](http://saadahmad.ca/cc-preprocessor-metaprogramming-2/) by Saad Ahmad.\n - [_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.\n - [_Outperforming LAPACK with C metaprogramming_](https://wordsandbuttons.online/outperforming_lapack_with_c_metaprogramming.html) by Oleksandr Kaleniuk.\n - [_C Pre-Processor Magic_](http://jhnet.co.uk/articles/cpp_magic) by Jonathan Heathcote.\n\n### [Jens Gustedt's Blog](https://gustedt.wordpress.com/category/c99/preprocessor/)\n\nSome worth-noting articles:\n\n - [_Handling control flow inside macros_](https://gustedt.wordpress.com/2011/02/02/handling-control-flow-inside-macros/)\n - [_Scope Bound Resource Management with `for` Scopes_](https://gustedt.wordpress.com/2010/08/14/scope-bound-resource-management-with-for-scopes/)\n - [_Detect empty macro arguments_](https://gustedt.wordpress.com/2010/06/08/detect-empty-macro-arguments/)\n - [_Default arguments for C99_](https://gustedt.wordpress.com/2010/06/03/default-arguments-for-c99/)\n\n## SO questions\n\n - [_Is the C99 preprocessor Turing complete?_](https://stackoverflow.com/questions/3136686/is-the-c99-preprocessor-turing-complete)\n - [_Can we have recursive macros?_](https://stackoverflow.com/questions/12447557/can-we-have-recursive-macros)\n - [_Overloading Macro on Number of Arguments_](https://stackoverflow.com/questions/11761703/overloading-macro-on-number-of-arguments)\n - [_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)\n - [_Understanding DEFER and OBSTRUCT macros_](https://stackoverflow.com/questions/29962560/understanding-defer-and-obstruct-macros)\n","projects_url":"https://awesome.ecosyste.ms/api/v1/lists/hirrolot%2Fawesome-c-preprocessor/projects"}