Skip to content

Commit

Permalink
Render include paths relative
Browse files Browse the repository at this point in the history
By removing `etl/` from include paths (in `#include` statements), the path to the directory `include/` doesn't need to be provided to the preprocessor as an include path if the files in `include/etl/` are included by other means.
This has no disadvantages.
Actually the form `#include "..."` is intended to be used for relative paths in the first place.

This is relevant if one wants to include the source files from `include/etl` only indirectly.

For example we use special generated header files which wrap the include statement of the vanilla header files with diagnostic commands.
Those commands allow to disable diagnostic for ETL's files and re-enable them after the file inclusion.
Wrapper files are generated for every non-private header file.
We provide the directory with the wrapper files as include path to the preprocessor instead of the normal `include/` directory.
Thus include statements like `#include "etl/private/..."` are invalid in that case.
  • Loading branch information
dhebbeker committed Aug 7, 2024
1 parent d68c5e5 commit 9369619
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/etl/intrusive_forward_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ namespace etl

reference operator *() const
{
#include "etl/private/diagnostic_null_dereference_push.h"
#include "private/diagnostic_null_dereference_push.h"
return *static_cast<pointer>(p_value);
#include "etl/private/diagnostic_pop.h"
#include "private/diagnostic_pop.h"
}

pointer operator &() const
Expand Down

0 comments on commit 9369619

Please sign in to comment.