Skip to content

Commit 697b881

Browse files
[libc] avoid c++ includes from MPFR
1 parent 943db67 commit 697b881

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

libc/utils/MPFRWrapper/mpfr_inc.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,21 @@
1717
// MPFR header can be included in manner allowed in that repo.
1818
#include "CustomMPFRIncluder.h"
1919
#else
20+
21+
extern "C" {
22+
#pragma push_macro("__cplusplus")
23+
#if defined(__clang__)
24+
#pragma clang diagnostic push
25+
#pragma clang diagnostic ignored "-Wbuiltin-macro-redefined"
26+
#endif
27+
#undef __cplusplus
2028
#include <mpfr.h>
29+
#if defined(__clang__)
30+
#pragma clang diagnostic pop
31+
#endif
32+
#pragma pop_macro("__cplusplus")
33+
}
34+
2135
#endif
2236

2337
#endif // LLVM_LIBC_UTILS_MPFRWRAPPER_MPFR_INC_H

0 commit comments

Comments
 (0)