From d9a9fa72a735cd6795405aafb6f4a652a51e913a Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Thu, 9 Jun 2022 18:57:36 +0300 Subject: [PATCH] Fixed __ATTR_PROGMEM__ by utilizing the variant available in clang (https://github.com/llvm/llvm-project/issues/55921#issuecomment-1150721383). --- include/avr/pgmspace.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/avr/pgmspace.h b/include/avr/pgmspace.h index f406865d..2f87ba56 100644 --- a/include/avr/pgmspace.h +++ b/include/avr/pgmspace.h @@ -95,8 +95,18 @@ #endif #ifndef __ATTR_PROGMEM__ +#if defined __has_attribute +#if __has_attribute(__progmem__) #define __ATTR_PROGMEM__ __attribute__((__progmem__)) #endif +#endif +#endif + +#ifndef __ATTR_PROGMEM__ +#ifdef __clang_version__ +#define __ATTR_PROGMEM__ __flash // not really an attr +#endif +#endif #ifndef __ATTR_PURE__ #define __ATTR_PURE__ __attribute__((__pure__))