From e63e8b868ef717ae84a694eaa6782899a396a1af Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Tue, 9 May 2023 19:25:30 +0200 Subject: [PATCH] uzlib(trezor): fix compilation with clang --- lib/uzlib/tinflate.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/uzlib/tinflate.c b/lib/uzlib/tinflate.c index 3eae52dcefab..894a61909d73 100644 --- a/lib/uzlib/tinflate.c +++ b/lib/uzlib/tinflate.c @@ -35,6 +35,12 @@ #include #include "tinf.h" +#if defined(__GNUC__) && (__GNUC__ >= 5) + #define OPTIMIZE_O3 __attribute__((optimize("-O3"))) +#else + #define OPTIMIZE_O3 +#endif + #define UZLIB_DUMP_ARRAY(heading, arr, size) \ { \ printf("%s", heading); \ @@ -549,7 +555,7 @@ void uzlib_uncompress_init(TINF_DATA *d, void *dict, unsigned int dictLen) } /* inflate next output bytes from compressed stream */ -__attribute__((optimize("-O3"))) +OPTIMIZE_O3 int uzlib_uncompress(TINF_DATA *d) { do {