1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

fix(draw_rect): delete __STDC_VERSION__ to ensure C++ compatibility (#3099)

This commit is contained in:
guoweilkd 2022-02-17 19:31:16 +08:00 committed by GitHub
parent fe4caaff0e
commit 060b37e8fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 10 deletions

View File

@ -38,9 +38,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_rect_dsc_init(lv_draw_rect_dsc_t * dsc)
{
lv_memset_00(dsc, sizeof(lv_draw_rect_dsc_t));
dsc->bg_color = lv_color_white();
#if __STDC_VERSION__ < 201112L
dsc->bg_grad.stops[0].color = lv_color_white();
#endif
dsc->bg_grad.stops[1].color = lv_color_black();
dsc->bg_grad.stops[1].frac = 0xFF;
dsc->bg_grad.stops_count = 2;

View File

@ -35,14 +35,8 @@ typedef struct {
/*Background*/
lv_opa_t bg_opa;
#if __STDC_VERSION__ >= 201112L
union {
#endif
lv_color_t bg_color; /**< First element of a gradient is a color, so it maps well here*/
lv_grad_dsc_t bg_grad;
#if __STDC_VERSION__ >= 201112L
};
#endif
lv_color_t bg_color; /**< First element of a gradient is a color, so it maps well here*/
lv_grad_dsc_t bg_grad;
/*Background img*/
const void * bg_img_src;