[libc-commits] [libc] fb542b0 - [libc][MPFRWrapper] Provide a way to include MPFR header in downstream repos.
Siva Chandra Reddy via libc-commits
libc-commits at lists.llvm.org
Wed Sep 9 12:59:19 PDT 2020
Author: Siva Chandra Reddy
Date: 2020-09-09T12:58:58-07:00
New Revision: fb542b0b8c209b05ba3100baf01718961e30fc26
URL: https://github.com/llvm/llvm-project/commit/fb542b0b8c209b05ba3100baf01718961e30fc26
DIFF: https://github.com/llvm/llvm-project/commit/fb542b0b8c209b05ba3100baf01718961e30fc26.diff
LOG: [libc][MPFRWrapper] Provide a way to include MPFR header in downstream repos.
Reviewed By: asteinhauser
Differential Revision: https://reviews.llvm.org/D87412
Added:
Modified:
libc/utils/MPFRWrapper/MPFRUtils.cpp
Removed:
################################################################################
diff --git a/libc/utils/MPFRWrapper/MPFRUtils.cpp b/libc/utils/MPFRWrapper/MPFRUtils.cpp
index a121234e6224..0520d8ae3ed9 100644
--- a/libc/utils/MPFRWrapper/MPFRUtils.cpp
+++ b/libc/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 {
More information about the libc-commits
mailing list