From 4c0d8ae8d77a76857abf4befc13d8f6c969c52e0 Mon Sep 17 00:00:00 2001 From: Zach White Date: Fri, 21 May 2021 16:59:10 -0700 Subject: [PATCH] ensure we do not conflict with existing keymap aliases (#12976) --- lib/python/qmk/cli/generate/layouts.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/python/qmk/cli/generate/layouts.py b/lib/python/qmk/cli/generate/layouts.py index ad6946d6cf..4de982f822 100755 --- a/lib/python/qmk/cli/generate/layouts.py +++ b/lib/python/qmk/cli/generate/layouts.py @@ -85,7 +85,9 @@ def generate_layouts(cli): for alias, target in kb_info_json.get('layout_aliases', {}).items(): layouts_h_lines.append('') - layouts_h_lines.append('#define %s %s' % (alias, target)) + layouts_h_lines.append(f'#ifndef {alias}') + layouts_h_lines.append(f'# define {alias} {target}') + layouts_h_lines.append('#endif') # Show the results layouts_h = '\n'.join(layouts_h_lines) + '\n'