From 52571b0f5aefb99cd55828945ccedc571c20d097 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Tue, 30 Jan 2024 00:45:27 +0100 Subject: gfx: #undef quad Surprisingly, esp-idf #includes files such as sys/types.h when pulling other standard header files, even when not explicitly defined. While this is not a serious issue, incredibly their sys/types.h implementation uses "#define quad", therefore breaking user code such as anything related to "struct quad". --- src/gfx/esp32/inc/gfx/port.h | 2 ++ src/gfx/esp32/src/quad.c | 2 ++ src/gfx/inc/gfx.h | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gfx/esp32/inc/gfx/port.h b/src/gfx/esp32/inc/gfx/port.h index 36a294f..fe14ccf 100644 --- a/src/gfx/esp32/inc/gfx/port.h +++ b/src/gfx/esp32/inc/gfx/port.h @@ -3,6 +3,8 @@ #include +#undef quad + #ifdef __cplusplus extern "C" { diff --git a/src/gfx/esp32/src/quad.c b/src/gfx/esp32/src/quad.c index 05eb5e9..71cbc0c 100644 --- a/src/gfx/esp32/src/quad.c +++ b/src/gfx/esp32/src/quad.c @@ -4,6 +4,8 @@ #include #include +#undef quad + int quad_from_sprite(const struct sprite *const s, struct quad *const q) { return -1; diff --git a/src/gfx/inc/gfx.h b/src/gfx/inc/gfx.h index 99deeeb..1cef275 100644 --- a/src/gfx/inc/gfx.h +++ b/src/gfx/inc/gfx.h @@ -1,9 +1,9 @@ #ifndef GFX_H #define GFX_H -#include #include #include +#include #ifdef __cplusplus extern "C" -- cgit v1.2.3