diff --git a/src/dev/sdl/lv_sdl_window.c b/src/dev/sdl/lv_sdl_window.c index 75e5b09ae8..97d828834a 100644 --- a/src/dev/sdl/lv_sdl_window.c +++ b/src/dev/sdl/lv_sdl_window.c @@ -15,6 +15,10 @@ #define SDL_MAIN_HANDLED /*To fix SDL's "undefined reference to WinMain" issue*/ #include LV_SDL_INCLUDE_PATH +#if LV_USE_DRAW_SDL + #include +#endif + /********************* * DEFINES *********************/ @@ -75,10 +79,12 @@ lv_display_t * lv_sdl_window_create(int32_t hor_res, int32_t ver_res) event_handler_timer = lv_timer_create(sdl_event_handler, 5, NULL); lv_tick_set_cb(SDL_GetTicks); +#if LV_USE_DRAW_SDL if(!(IMG_Init(IMG_INIT_PNG) & IMG_INIT_PNG)) { fprintf(stderr, "could not initialize sdl2_image: %s\n", IMG_GetError()); return NULL; } +#endif inited = true; } diff --git a/src/libs/libjpeg_turbo/lv_libjpeg_turbo.c b/src/libs/libjpeg_turbo/lv_libjpeg_turbo.c index 0d2b0fe2d4..0c68c6eaf3 100644 --- a/src/libs/libjpeg_turbo/lv_libjpeg_turbo.c +++ b/src/libs/libjpeg_turbo/lv_libjpeg_turbo.c @@ -475,12 +475,10 @@ static void error_exit(j_common_ptr cinfo) longjmp(myerr->jb, 1); } - static void cache_invalidate_cb(lv_cache_entry_t * entry) { if(entry->src_type == LV_CACHE_SRC_TYPE_PATH) lv_free((void *)entry->src); lv_free((void *)entry->data); } - #endif /*LV_USE_LIBJPEG_TURBO*/ diff --git a/src/libs/libpng/lv_libpng.c b/src/libs/libpng/lv_libpng.c index 59be1f007d..f517a8c0b4 100644 --- a/src/libs/libpng/lv_libpng.c +++ b/src/libs/libpng/lv_libpng.c @@ -301,7 +301,6 @@ static const void * decode_png_file(const char * filename) return image_data; } - static void cache_invalidate_cb(lv_cache_entry_t * entry) { lv_free((void *)entry->src); diff --git a/src/libs/tiny_ttf/lv_tiny_ttf.c b/src/libs/tiny_ttf/lv_tiny_ttf.c index 2592038dc7..214cbd6da9 100644 --- a/src/libs/tiny_ttf/lv_tiny_ttf.c +++ b/src/libs/tiny_ttf/lv_tiny_ttf.c @@ -126,7 +126,6 @@ static void cache_invalidate_cb(lv_cache_entry_t * entry) lv_draw_buf_free((void *)entry->data); } - static const uint8_t * ttf_get_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter, uint8_t * bitmap_buf) { LV_UNUSED(bitmap_buf); @@ -288,5 +287,4 @@ void lv_tiny_ttf_destroy(lv_font_t * font) } } - #endif