fix: add guard macros to lv_style_gen.c,h and lv_obj_style_gen.c,h (#4450)

This commit is contained in:
Kevin Schlosser
2023-08-16 14:24:37 -06:00
committed by GitHub
parent ea6d27682b
commit dcffe24094
5 changed files with 79 additions and 0 deletions

View File

@@ -502,34 +502,64 @@ def docs(p):
base_dir = os.path.abspath(os.path.dirname(__file__))
sys.stdout = open(base_dir + '/../src/core/lv_obj_style_gen.h', 'w')
HEADING = f'''
/*
**********************************************************************
* DO NOT EDIT
* This file is automatically generated by "{os.path.split(__file__)[-1]}"
**********************************************************************
*/
'''
print(HEADING)
print('#ifndef LV_OBJ_STYLE_GEN_H')
print('#define LV_OBJ_STYLE_GEN_H')
print()
print("#include \"../misc/lv_area.h\"")
print("#include \"../misc/lv_style.h\"")
print("#include \"../core/lv_obj_style.h\"")
print()
for p in props:
obj_style_get(p)
for p in props:
local_style_set_h(p)
print()
print('#endif /* LV_OBJ_STYLE_GEN_H */')
sys.stdout = open(base_dir + '/../src/core/lv_obj_style_gen.c', 'w')
print(HEADING)
print("#include \"lv_obj.h\"")
print()
for p in props:
local_style_set_c(p)
sys.stdout = open(base_dir + '/../src/misc/lv_style_gen.c', 'w')
print(HEADING)
print("#include \"lv_style.h\"")
print()
for p in props:
style_set_c(p)
sys.stdout = open(base_dir + '/../src/misc/lv_style_gen.h', 'w')
print(HEADING)
print('#ifndef LV_STYLE_GEN_H')
print('#define LV_STYLE_GEN_H')
print()
for p in props:
style_set_h(p)
for p in props:
style_const_set(p)
print()
print('#endif /* LV_STYLE_GEN_H */')
sys.stdout = open(base_dir + '/../docs/overview/style-props.md', 'w')