aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-01-30 00:45:27 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-01-30 23:49:22 +0100
commit52571b0f5aefb99cd55828945ccedc571c20d097 (patch)
tree9d8f007467500433bdfdd389317e0936de7f5d15
parent77c4420c06d5eefc47cfca9b686f5d5e916408fe (diff)
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".
-rw-r--r--src/gfx/esp32/inc/gfx/port.h2
-rw-r--r--src/gfx/esp32/src/quad.c2
-rw-r--r--src/gfx/inc/gfx.h2
3 files changed, 5 insertions, 1 deletions
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 <stdbool.h>
+#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 <stddef.h>
#include <stdlib.h>
+#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 <gfx/port.h>
#include <stdbool.h>
#include <stdio.h>
+#include <gfx/port.h>
#ifdef __cplusplus
extern "C"