From b920e31dbbb38f6fc0751ce72017602ce8938983 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/avr/pgmspace.h b/include/avr/pgmspace.h index f406865d..e4380113 100644 --- a/include/avr/pgmspace.h +++ b/include/avr/pgmspace.h @@ -95,8 +95,16 @@ #endif #ifndef __ATTR_PROGMEM__ +#if __has_attribute(__progmem__) #define __ATTR_PROGMEM__ __attribute__((__progmem__)) #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__))