[libc-commits] [libc] [libc] Add the missing math_extras.h include (PR #74259)

via libc-commits libc-commits at lists.llvm.org
Sun Dec 3 14:46:36 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Petr Hosek (petrhosek)

<details>
<summary>Changes</summary>

math_extras.h is used in integer_utils.h when building for 32-bit platforms but the include is missing.

---
Full diff: https://github.com/llvm/llvm-project/pull/74259.diff


2 Files Affected:

- (modified) libc/src/__support/CMakeLists.txt (+1) 
- (modified) libc/src/__support/integer_utils.h (+4) 


``````````diff
diff --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt
index ba80965b5aaaf..d6dbad661cb73 100644
--- a/libc/src/__support/CMakeLists.txt
+++ b/libc/src/__support/CMakeLists.txt
@@ -189,6 +189,7 @@ add_header_library(
     integer_utils.h
   DEPENDS
     .bit
+    .math_extras
     .number_pair
     libc.src.__support.common
     libc.src.__support.CPP.type_traits
diff --git a/libc/src/__support/integer_utils.h b/libc/src/__support/integer_utils.h
index 433e99227bcfd..619e13f51c411 100644
--- a/libc/src/__support/integer_utils.h
+++ b/libc/src/__support/integer_utils.h
@@ -15,6 +15,10 @@
 #include "bit.h"
 #include "number_pair.h"
 
+#ifndef __SIZEOF_INT128__
+#include "math_extras.h"
+#endif
+
 #include <stdint.h>
 
 namespace LIBC_NAMESPACE {

``````````

</details>


https://github.com/llvm/llvm-project/pull/74259


More information about the libc-commits mailing list