From 9ed36ec22f7ea880b64fa11d2c0d49485287ad03 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Thu, 22 Sep 2022 18:10:36 -0400 Subject: FS#13361: Fix some compilation under MacOS (Michael Landherr) Change-Id: Id7e0576e355a1d71493fb7b277fd92f38b7edab4 --- docs/CREDITS | 1 + firmware/export/config.h | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/CREDITS b/docs/CREDITS index 3a6fcb83b9..86e009c8a8 100644 --- a/docs/CREDITS +++ b/docs/CREDITS @@ -711,6 +711,7 @@ Fabrice Bellard Selami Dinçer Matej Golian James Le Cuirot +Michael Landherr The libmad team The wavpack team diff --git a/firmware/export/config.h b/firmware/export/config.h index 5cb89ed15a..2519b87f0d 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -1078,8 +1078,16 @@ Lyre prototype 1 */ * only while main() runs), otherwise things may go wild, * from crashes to freezes to exploding daps. */ -#define INIT_ATTR __attribute__ ((section(".init"))) -#define INITDATA_ATTR __attribute__ ((section(".initdata"))) + + +#if defined(__APPLE__) && defined(__MACH__) + #define INIT_ATTR __attribute__((section ("__INIT,.init"))) + #define INITDATA_ATTR __attribute__((section ("__INITDATA,.initdata"))) +#else + #define INIT_ATTR __attribute__ ((section(".init"))) + #define INITDATA_ATTR __attribute__ ((section(".initdata"))) +#endif + #define HAVE_INIT_ATTR #else #define INIT_ATTR -- cgit v1.2.3