From c6b34bc85bb6f5e57e1c87857e03d1a0bd225e4c Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Fri, 11 Feb 2022 09:25:44 -0500 Subject: [PATCH] fix(conf): work around GCC bug (#3082) Fixes #3078 --- scripts/lv_conf_internal_gen.py | 5 +++++ src/lv_conf_internal.h | 5 +++++ tests/src/lv_test_conf.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/scripts/lv_conf_internal_gen.py b/scripts/lv_conf_internal_gen.py index 3801a07e5..44e2079a2 100755 --- a/scripts/lv_conf_internal_gen.py +++ b/scripts/lv_conf_internal_gen.py @@ -57,6 +57,11 @@ fout.write( #else #include "../../lv_conf.h" /*Else assume lv_conf.h is next to the lvgl folder*/ #endif + #if !defined(LV_CONF_H) && !defined(LV_CONF_SUPPRESS_DEFINE_CHECK) + /* #include will sometimes silently fail when __has_include is used */ + /* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80753 */ + #pragma message("Possible failure to include lv_conf.h, please read the comment in this file if you get errors") + #endif #endif #ifdef CONFIG_LV_COLOR_DEPTH diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index d7321ad26..456c72844 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -40,6 +40,11 @@ #else #include "../../lv_conf.h" /*Else assume lv_conf.h is next to the lvgl folder*/ #endif + #if !defined(LV_CONF_H) && !defined(LV_CONF_SUPPRESS_DEFINE_CHECK) + /* #include will sometimes silently fail when __has_include is used */ + /* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80753 */ + #pragma message("Possible failure to include lv_conf.h, please read the comment in this file if you get errors") + #endif #endif #ifdef CONFIG_LV_COLOR_DEPTH diff --git a/tests/src/lv_test_conf.h b/tests/src/lv_test_conf.h index a1e855705..7d28ef609 100644 --- a/tests/src/lv_test_conf.h +++ b/tests/src/lv_test_conf.h @@ -6,6 +6,8 @@ #ifndef LV_TEST_CONF_H #define LV_TEST_CONF_H +#define LV_CONF_SUPPRESS_DEFINE_CHECK 1 + #ifdef __cplusplus extern "C" { #endif