Skip to content

Commit 527359f

Browse files
authored
Make include paths to private files relative (#946)
* Render include paths relative 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. * Remove "etl/" from include paths in all files in `include/`. 33 findings in 4 files of 375. See 9369619 for explanation.
1 parent 16cd116 commit 527359f

File tree

5 files changed

+37
-37
lines changed

5 files changed

+37
-37
lines changed

include/etl/base64.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ SOFTWARE.
2626
#ifndef ETL_BASE64_INCLUDED
2727
#define ETL_BASE64_INCLUDED
2828

29-
#include "etl/platform.h"
30-
#include "etl/static_assert.h"
31-
#include "etl/exception.h"
32-
#include "etl/error_handler.h"
33-
#include "etl/type_traits.h"
34-
#include "etl/enum_type.h"
35-
#include "etl/integral_limits.h"
29+
#include "platform.h"
30+
#include "static_assert.h"
31+
#include "exception.h"
32+
#include "error_handler.h"
33+
#include "type_traits.h"
34+
#include "enum_type.h"
35+
#include "integral_limits.h"
3636

3737
#include <stdint.h>
3838

include/etl/base64_decoder.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ SOFTWARE.
2828
#ifndef ETL_BASE64_DECODER_INCLUDED
2929
#define ETL_BASE64_DECODER_INCLUDED
3030

31-
#include "etl/platform.h"
32-
#include "etl/static_assert.h"
33-
#include "etl/error_handler.h"
34-
#include "etl/type_traits.h"
35-
#include "etl/binary.h"
36-
#include "etl/algorithm.h"
37-
#include "etl/integral_limits.h"
38-
#include "etl/iterator.h"
39-
#include "etl/enum_type.h"
40-
#include "etl/delegate.h"
41-
#include "etl/span.h"
42-
43-
#include "etl/base64.h"
31+
#include "platform.h"
32+
#include "static_assert.h"
33+
#include "error_handler.h"
34+
#include "type_traits.h"
35+
#include "binary.h"
36+
#include "algorithm.h"
37+
#include "integral_limits.h"
38+
#include "iterator.h"
39+
#include "enum_type.h"
40+
#include "delegate.h"
41+
#include "span.h"
42+
43+
#include "base64.h"
4444

4545
#include <stdint.h>
4646

include/etl/base64_encoder.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ SOFTWARE.
2828
#ifndef ETL_BASE64_ENCODER_INCLUDED
2929
#define ETL_BASE64_ENCODER_INCLUDED
3030

31-
#include "etl/platform.h"
32-
#include "etl/static_assert.h"
33-
#include "etl/error_handler.h"
34-
#include "etl/type_traits.h"
35-
#include "etl/binary.h"
36-
#include "etl/algorithm.h"
37-
#include "etl/integral_limits.h"
38-
#include "etl/iterator.h"
39-
#include "etl/enum_type.h"
40-
#include "etl/delegate.h"
41-
#include "etl/span.h"
42-
43-
#include "etl/base64.h"
31+
#include "platform.h"
32+
#include "static_assert.h"
33+
#include "error_handler.h"
34+
#include "type_traits.h"
35+
#include "binary.h"
36+
#include "algorithm.h"
37+
#include "integral_limits.h"
38+
#include "iterator.h"
39+
#include "enum_type.h"
40+
#include "delegate.h"
41+
#include "span.h"
42+
43+
#include "base64.h"
4444

4545
#include <stdint.h>
4646

include/etl/intrusive_forward_list.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,9 @@ namespace etl
489489

490490
reference operator *() const
491491
{
492-
#include "etl/private/diagnostic_null_dereference_push.h"
492+
#include "private/diagnostic_null_dereference_push.h"
493493
return *static_cast<pointer>(p_value);
494-
#include "etl/private/diagnostic_pop.h"
494+
#include "private/diagnostic_pop.h"
495495
}
496496

497497
pointer operator &() const

include/etl/intrusive_list.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,9 @@ namespace etl
528528

529529
reference operator *() const
530530
{
531-
#include "etl/private/diagnostic_null_dereference_push.h"
531+
#include "private/diagnostic_null_dereference_push.h"
532532
return *static_cast<pointer>(p_value);
533-
#include "etl/private/diagnostic_pop.h"
533+
#include "private/diagnostic_pop.h"
534534
}
535535

536536
pointer operator &() const

0 commit comments

Comments
 (0)