summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2020-10-14 15:42:18 +0200
committerDamien George <damien@micropython.org>2020-10-29 15:28:14 +1100
commite498a8bd13a0ecdf1cc50f57eb6d3630e8c0c078 (patch)
tree8a910f3f043dd92f0faaa12c85222678cdc24ab8
parent8e94fa0d2eb94483f387b1ae2e081d1998575a7f (diff)
py: Workaround clang error when building misc.h with C++ compiler.
-rw-r--r--py/misc.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/py/misc.h b/py/misc.h
index 2dd20365c..aac907244 100644
--- a/py/misc.h
+++ b/py/misc.h
@@ -272,7 +272,12 @@ typedef union _mp_float_union_t {
// Map MP_COMPRESSED_ROM_TEXT to the compressed strings.
// Force usage of the MP_ERROR_TEXT macro by requiring an opaque type.
-typedef struct {} *mp_rom_error_text_t;
+typedef struct {
+ #ifdef __clang__
+ // Fix "error: empty struct has size 0 in C, size 1 in C++".
+ char dummy;
+ #endif
+} *mp_rom_error_text_t;
#include <string.h>