From 8b28aba87459eab3a481ab46e73e2a9a2dae6f5b Mon Sep 17 00:00:00 2001 From: Stephen Canon Date: Wed, 28 May 2025 15:44:01 -0400 Subject: [PATCH] Cherry-pick "Add extern "C" to shim header file" #307 to 1.0.x --- Sources/_NumericsShims/include/_NumericsShims.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sources/_NumericsShims/include/_NumericsShims.h b/Sources/_NumericsShims/include/_NumericsShims.h index 7e25eab..c87010a 100644 --- a/Sources/_NumericsShims/include/_NumericsShims.h +++ b/Sources/_NumericsShims/include/_NumericsShims.h @@ -9,6 +9,10 @@ // //===----------------------------------------------------------------------===// +#ifdef __cplusplus +extern "C" { +#endif + #define HEADER_SHIM static inline __attribute__((__always_inline__)) // This header uses most of the libm functions, but we don't want to end up @@ -397,3 +401,7 @@ HEADER_SHIM double _numerics_muladd(double a, double b, double c) { // No long-double muladd operation, because no one has built an FMA for it // (except for Itanium, which Swift doesn't support). + +#ifdef __cplusplus +} +#endif