From 614538bc706e21a524599e48f238bfa4d6671800 Mon Sep 17 00:00:00 2001
From: Virgile Prevosto <virgile.prevosto@m4x.org>
Date: Tue, 9 Jul 2024 15:48:10 +0200
Subject: [PATCH] [libc] avoid using #pragma inside macros for better
 portability

---
 share/libc/features.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/share/libc/features.h b/share/libc/features.h
index fab4fd114cd..a5dcd40abb5 100644
--- a/share/libc/features.h
+++ b/share/libc/features.h
@@ -27,8 +27,10 @@
 // and GNU-based code ***
 
 #ifdef __FRAMAC__
-#define __PUSH_FC_STDLIB #pragma fc_stdlib(push,__FILE__)
-#define __POP_FC_STDLIB #pragma fc_stdlib(pop)
+#define __PRAGMA(x) _Pragma(#x)
+#define __PRAGMA_PUSH(f) __PRAGMA(fc_stdlib(push,f))
+#define __PUSH_FC_STDLIB __PRAGMA_PUSH(__FILE__)
+#define __POP_FC_STDLIB __PRAGMA(fc_stdlib(pop))
 #else
 #define __PUSH_FC_STDLIB
 #define __POP_FC_STDLIB
-- 
GitLab