[libc][MPFRWrapper] Provide a way to include MPFR header in downstream repos.
Reviewed By: asteinhauser
Differential Revision: https://reviews.llvm.org/D87412
GitOrigin-RevId: fb542b0b8c209b05ba3100baf01718961e30fc26
diff --git a/utils/MPFRWrapper/MPFRUtils.cpp b/utils/MPFRWrapper/MPFRUtils.cpp
index a121234..0520d8a 100644
--- a/utils/MPFRWrapper/MPFRUtils.cpp
+++ b/utils/MPFRWrapper/MPFRUtils.cpp
@@ -15,10 +15,20 @@
#include "llvm/ADT/StringRef.h"
#include <memory>
-#include <mpfr.h>
#include <stdint.h>
#include <string>
+#ifdef CUSTOM_MPFR_INCLUDER
+// Some downstream repos are monoliths carrying MPFR sources in their third
+// party directory. In such repos, including the MPFR header as
+// `#include <mpfr.h>` is either disallowed or not possible. If that is the
+// case, a file named `CustomMPFRIncluder.h` should be added through which the
+// MPFR header can be included in manner allowed in that repo.
+#include "CustomMPFRIncluder.h"
+#else
+#include <mpfr.h>
+#endif
+
template <typename T> using FPBits = __llvm_libc::fputil::FPBits<T>;
namespace __llvm_libc {