From 28addaf3cee7815b53c9c69b85db08193539f25c Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 16 Feb 2021 14:23:18 +0100 Subject: [PATCH] add some missong LV_USE_... guards --- examples/get_started/lv_example_get_started_1.c | 3 +++ src/extra/layouts/flex/lv_flex.c | 4 ++++ src/extra/layouts/flex/lv_flex.h | 3 +++ src/extra/layouts/grid/lv_grid.c | 3 +++ src/extra/layouts/grid/lv_grid.h | 2 ++ 5 files changed, 15 insertions(+) diff --git a/examples/get_started/lv_example_get_started_1.c b/examples/get_started/lv_example_get_started_1.c index 092fec254..8f7402792 100644 --- a/examples/get_started/lv_example_get_started_1.c +++ b/examples/get_started/lv_example_get_started_1.c @@ -1,4 +1,5 @@ #include "../../lvgl.h" +#if LV_BUILD_EXAMPLES static void btn_event_cb(lv_obj_t * btn, lv_event_t event) { @@ -26,3 +27,5 @@ void lv_example_get_started_1(void) lv_label_set_text(label, "Button"); /*Set the labels text*/ } +#endif + diff --git a/src/extra/layouts/flex/lv_flex.c b/src/extra/layouts/flex/lv_flex.c index 8b8e10a75..3cfe664fe 100644 --- a/src/extra/layouts/flex/lv_flex.c +++ b/src/extra/layouts/flex/lv_flex.c @@ -8,6 +8,8 @@ *********************/ #include "lv_flex.h" +#if LV_USE_FLEX + /********************* * DEFINES *********************/ @@ -446,3 +448,5 @@ static lv_obj_t * get_next_item(lv_obj_t * cont, bool rev, int32_t * item_id) else return NULL; } } + +#endif /*LV_USE_FLEX*/ diff --git a/src/extra/layouts/flex/lv_flex.h b/src/extra/layouts/flex/lv_flex.h index 694044366..11c0c7475 100644 --- a/src/extra/layouts/flex/lv_flex.h +++ b/src/extra/layouts/flex/lv_flex.h @@ -14,6 +14,7 @@ extern "C" { * INCLUDES *********************/ #include "../../../lv_core/lv_obj.h" +#if LV_USE_FLEX /********************* * DEFINES @@ -112,6 +113,8 @@ extern const lv_flex_t lv_flex_even; /**< Place the items evenly in r * MACROS **********************/ +#endif /*LV_USE_FLEX*/ + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/extra/layouts/grid/lv_grid.c b/src/extra/layouts/grid/lv_grid.c index bdb24e48c..d464b71f9 100644 --- a/src/extra/layouts/grid/lv_grid.c +++ b/src/extra/layouts/grid/lv_grid.c @@ -7,6 +7,7 @@ * INCLUDES *********************/ #include "lv_grid.h" +#if LV_USE_GRID /********************* * DEFINES @@ -479,3 +480,5 @@ static lv_coord_t grid_place(lv_coord_t cont_size, bool auto_size, uint8_t plac /*Return the full size of the grid*/ return total_gird_size; } + +#endif /*LV_USE_GRID*/ diff --git a/src/extra/layouts/grid/lv_grid.h b/src/extra/layouts/grid/lv_grid.h index 166344689..436a86d94 100644 --- a/src/extra/layouts/grid/lv_grid.h +++ b/src/extra/layouts/grid/lv_grid.h @@ -18,6 +18,7 @@ extern "C" { /********************* * DEFINES *********************/ +#if LV_USE_GRID /********************** * TYPEDEFS @@ -123,6 +124,7 @@ extern const lv_grid_t grid_12; /********************** * MACROS **********************/ +#endif /*LV_USE_GRID*/ #ifdef __cplusplus } /* extern "C" */