Skip to content

Commit 5dd2904

Browse files
theotherjimmyadbridge
authored andcommitted
Stabilize macro ordering in mbed_config.h
1 parent 038365f commit 5dd2904

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tools/config/__init__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,10 +1054,14 @@ def config_to_header(config, fname=None):
10541054
Config._check_required_parameters(params)
10551055
params_with_values = [p for p in params.values() if p.value is not None]
10561056
ctx = {
1057-
"cfg_params" : [(p.macro_name, str(p.value), p.set_by)
1058-
for p in params_with_values],
1059-
"macros": [(m.macro_name, str(m.macro_value or ""), m.defined_by)
1060-
for m in macros.values()],
1057+
"cfg_params": sorted([
1058+
(p.macro_name, str(p.value), p.set_by)
1059+
for p in params_with_values
1060+
]),
1061+
"macros": sorted([
1062+
(m.macro_name, str(m.macro_value or ""), m.defined_by)
1063+
for m in macros.values()
1064+
]),
10611065
"name_len": max([len(m.macro_name) for m in macros.values()] +
10621066
[len(m.macro_name) for m in params_with_values]
10631067
+ [0]),

0 commit comments

Comments
 (0)