Circular include best ways to avoid?
Posted: Thu Nov 14, 2024 11:02 pm
so I have file a.pbi, it contains a structure that uses something from b.pbi as a list, then I have procedures that take pointers of a in b.pbi, as well as a prototype function. As you would have figured, I ran into a include sircular loop, if I use XIncludeFile, well, it will loop, and if I include somewhere else one of them will be included before the other so they just both break anyway
so any ideas? I would like to avoid putting 2 directly unrelated structures in one place, because I'll eventually have a messy bunch of files, in C/C++ this will be done by headers, but I'm not sure if this would work considering there are no structure declarations to my knowledge, only procedure declarations, which fixes half the problem.
I'm aware that I likely could go rewrite the code to avoid the problem, but I'm curious if there's no solution to that?
so any ideas? I would like to avoid putting 2 directly unrelated structures in one place, because I'll eventually have a messy bunch of files, in C/C++ this will be done by headers, but I'm not sure if this would work considering there are no structure declarations to my knowledge, only procedure declarations, which fixes half the problem.
I'm aware that I likely could go rewrite the code to avoid the problem, but I'm curious if there's no solution to that?