From df381fd0c0092feecaf8c2e91565176293356551 Mon Sep 17 00:00:00 2001 From: "Tiago M. Vieira" Date: Wed, 22 Jul 2020 16:08:17 -0400 Subject: [PATCH] extend visibility of nibble_to_hex_upper and nibble_to_hex_lower --- py/objstr.c | 2 ++ py/objstr.h | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/py/objstr.c b/py/objstr.c index 5e0c6fdfaa2b9..8f31566a79acc 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -25,6 +25,8 @@ * THE SOFTWARE. */ +#define MICROPY_INSIDE_PY_OBJSTR_C + #include #include diff --git a/py/objstr.h b/py/objstr.h index 4b5e2054e0a57..9a227e76606cf 100644 --- a/py/objstr.h +++ b/py/objstr.h @@ -77,8 +77,14 @@ const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, s mp_obj_t index, bool is_slice); const byte *find_subbytes(const byte *haystack, size_t hlen, const byte *needle, size_t nlen, int direction); -const char nibble_to_hex_upper[16]; -const char nibble_to_hex_lower[16]; +#ifdef MICROPY_INSIDE_PY_OBJSTR_C +#define EXTERN +#else +#define EXTERN extern +#endif + +EXTERN const char nibble_to_hex_upper[16]; +EXTERN const char nibble_to_hex_lower[16]; MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_encode_obj); MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_find_obj);