From 1be6eb5b4743d3b81f342e7398b87b5fd7d78b85 Mon Sep 17 00:00:00 2001 From: John Hui Date: Thu, 22 May 2025 18:09:02 -0700 Subject: [PATCH] Add extern "C" to shim header file Adding this allows this package to be used with C++ interop enabled. Otherwise, building a package that depends on this leads to linker errors rdar://113756245 --- 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 016c235..87954b0 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 @@ -450,3 +454,7 @@ HEADER_SHIM void _numerics_optimization_barrier(const void *pointer) { } #undef CLANG_RELAX_FP + +#ifdef __cplusplus +} +#endif