Skip to content

Comment on Show HN: Header-only GIF decoder in pure C – no malloc, easy to useparent

Comments

In particular, you can define the implementation flag and include the header in a .c file with no other contents to recover the more “traditional” build set up where you have a separate TU dedicated to the library.

I quite like the flexibility it provides in terms of making “unity builds” very easy, and scaling down quite well to small, single-TU projects with minimal build set ups.

Exactly! That flexibility was one of my goals. Making integration smooth for both small embedded projects and larger codebases with unity builds — glad to hear it resonates.

I first encountered the idea relatively recently with Clay [1] and I have been a fan since. Once you get past the “huh, weird” stage it has a lot of benefits!

1: https://github.com/nicbarker/clay

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.