py: Workaround clang error when building misc.h with C++ compiler.

This commit is contained in:
stijn 2020-10-14 15:42:18 +02:00 committed by Damien George
parent 8e94fa0d2e
commit e498a8bd13

View File

@ -272,7 +272,12 @@ typedef union _mp_float_union_t {
// Map MP_COMPRESSED_ROM_TEXT to the compressed strings. // Map MP_COMPRESSED_ROM_TEXT to the compressed strings.
// Force usage of the MP_ERROR_TEXT macro by requiring an opaque type. // 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> #include <string.h>