Re:Adding Modules to C in 10 Lines of Code [pdf]
by unsafecast on Monday June 27, 2022 @08:02AM
(#31893339)
Yeah. Though most projects still use header files with unity builds, so I decided not to call them that. It wasn't the concept of a unity build that I was emphasising, it was the idea of not forward-declaring everything.
[ Parent
| on HN ]
Re:Adding Modules to C in 10 Lines of Code [pdf]
by arinlen on Tuesday June 28, 2022 @01:18AM
(#31904370)
> Yeah. Though most projects still use header files with unity builds, so I decided not to call them that.
There is nothing inherently special in header files. They are just a convention where you use a specific extension in source files you mostly use to pass declarations. Nothing stops you from using the .c extension on all files, and there is nothing special in passing declarations in one place and definitions in another place.
Re:Adding Modules to C in 10 Lines of Code [pdf]
by unsafecast on Sunday July 10, 2022 @10:18AM
(#32044996)
Of course! But, saying 'unity build' puts emphasis on the fact that you compile all the C files 'in unity', in a single CU. What _I_ wanted to put emphasis on is that you can skip the header files, and that coincidentally means you also have to unity build.
The fact that most unity built projects still use headers made me hesitant to use the term, as that would put emphasis on building a single CU, as opposed to not forward declaring in headers.