[libc-commits] [libc] [llvm] [libc][NFC] Fix missing LIBC_INLINE + style (PR #73659)

via libc-commits libc-commits at lists.llvm.org
Wed Dec 6 14:39:16 PST 2023


================
@@ -24,74 +26,74 @@ constexpr unsigned long long ULLONG_MAX = ~0ULL;
 
 template <class T> class numeric_limits {
 public:
-  static constexpr T max();
-  static constexpr T min();
+  LIBC_INLINE static constexpr T max();
+  LIBC_INLINE static constexpr T min();
 };
 
 // TODO: Add numeric_limits specializations as needed for new types.
 
 template <> class numeric_limits<int> {
 public:
-  static constexpr int max() { return INT_MAX; }
-  static constexpr int min() { return INT_MIN; }
+  LIBC_INLINE static constexpr int max() { return INT_MAX; }
----------------
michaelrj-google wrote:

The `LIBC_INLINE` macro implies `inline`, but some of our users (specifically Fuchsia) redefine the macro themselves to ensure that inlined functions also have additional properties. In Fuchsia's case they use it to enforce internal linkage. Linked below is their definition, along with a comment explaining why this is necessary.

https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/system/ulib/c/string/mem-aliases-include/src/__support/macros/attributes.h;l=24

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


More information about the libc-commits mailing list