-
Notifications
You must be signed in to change notification settings - Fork 106
Description
We have a lot of usage of "truncated" include paths in our melee code, such as the following:
Lines 3 to 10 in ea08f37
| #include "ft/forward.h" | |
| #include "ft/ftparts.h" | |
| #include "ft/fighter.h" | |
| #include "ft/inlines.h" | |
| #include "ft/types.h" | |
| #include "lb/lbrefract.h" |
Because of this, we are including files relative to src/ as well as src/melee/, so both have to be added to the include path.
To be consistent with C coding standards, we should limit the number of include paths that need to be added to the compile-line - so just src/ for melee code. We should only use quote-includes for paths relative to the current file, and use bracket-includes for fully-qualified includes relative to include paths.
I would propose that the above snippet could look like this:
#include "forward.h"
#include "ftparts.h"
#include "fighter.h"
#include "inlines.h"
#include "types.h"
#include <melee/lb/lbrefract.h> The choice to use quote-includes for files in the same directory is a matter of taste. One could also fully-qualify all includes, like this:
#include <melee/ft/forward.h>
#include <melee/ft/ftparts.h>
#include <melee/ft/fighter.h>
#include <melee/ft/inlines.h>
#include <melee/ft/types.h>
#include <melee/lb/lbrefract.h>