From e498a8bd13a0ecdf1cc50f57eb6d3630e8c0c078 Mon Sep 17 00:00:00 2001 From: stijn Date: Wed, 14 Oct 2020 15:42:18 +0200 Subject: [PATCH] py: Workaround clang error when building misc.h with C++ compiler. --- py/misc.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/py/misc.h b/py/misc.h index 2dd20365c9..aac9072446 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