diff options
author | stijn <stijn@ignitron.net> | 2020-10-14 15:42:18 +0200 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2020-10-29 15:28:14 +1100 |
commit | e498a8bd13a0ecdf1cc50f57eb6d3630e8c0c078 (patch) | |
tree | 8a910f3f043dd92f0faaa12c85222678cdc24ab8 | |
parent | 8e94fa0d2eb94483f387b1ae2e081d1998575a7f (diff) |
py: Workaround clang error when building misc.h with C++ compiler.
-rw-r--r-- | py/misc.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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> |