[libc-commits] [PATCH] D87412: [libc][MPFRWrapper] Provide a way to include MPFR header in downstream repos.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Sep 9 12:57:20 PDT 2020


sivachandra created this revision.
sivachandra added a reviewer: asteinhauser.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added a project: libc-project.
sivachandra requested review of this revision.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87412

Files:
  libc/utils/MPFRWrapper/MPFRUtils.cpp


Index: libc/utils/MPFRWrapper/MPFRUtils.cpp
===================================================================
--- libc/utils/MPFRWrapper/MPFRUtils.cpp
+++ 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 {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87412.290808.patch
Type: text/x-patch
Size: 887 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20200909/2b24e3b1/attachment.bin>


More information about the libc-commits mailing list