USSTRocketry / MiniRockets

Making rockets that hopefully go UP!
MIT License
2 stars 11 forks source link

Add ifndef to include statements #26

Closed frroossst closed 1 year ago

frroossst commented 1 year ago

To prevent possible errors in linkage

snowy-shadow commented 1 year ago

bro 💀 that's a lot of ifndef could you elaborate what you mean by possible errors in linkage?

frroossst commented 1 year ago

With a big enough project, we might end up creating circular dependencies which will cause a linker error when trying to compile the program. And it is generally a good practice to avoid double #includes

https://en.wikipedia.org/wiki/Include_guard#Double_inclusion

It's just good practice to keep everything fairly standard as the code will tend towards more entropy as it gets larger and we rush code.

And yes, that's a lot of ifndef, but we aren't doing anything until after the new year's

frroossst commented 1 year ago

Completed with commit https://github.com/USSTR-Avionics/Avionics_code/commit/5e7e394af271c8ed9ef26b151c73a38915443c32