Re:Wave Function Collapse library in pure C
by pantalaimon on Wednesday January 05, 2022 @07:08AM
(#29807985)
You don't need an elaborate build system to add a single .c file to your project
[ Parent
| on HN ]
Re:Wave Function Collapse library in pure C
by chii on Wednesday January 05, 2022 @07:18AM
(#29808053)
and now you need to add a .h to where ever you need to call those function. This .h will need to know if it got included multiple times, and so isn't just a trivial declaration.
It's just easier to have a single .h you include.
Re:Wave Function Collapse library in pure C
by charcircuit on Wednesday January 05, 2022 @08:08AM
(#29808408)
>to add a .h to where ever you need to call those function
No, it can be in a single place and you can just #include it.
>This .h will need to know if it got included multiple times, and so isn't just a trivial declaration.
This is the point of using header guards.
>It's just easier to have a single .h you include.
Depending on the build tool it's the same or only marginally easier (you save like 10 characters)