[libc-commits] [libc] [libc] Add limits.h header. (PR #78887)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Tue Jan 23 10:46:58 PST 2024


================
@@ -0,0 +1,251 @@
+//===-- Definition of macros from limits.h --------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __LLVM_LIBC_MACROS_LIMITS_MACROS_H
+#define __LLVM_LIBC_MACROS_LIMITS_MACROS_H
+
+#if __has_include_next(<limits.h>)
+
+// Suppress `#include_next is a language extension` warnings.
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu-include-next"
----------------
nickdesaulniers wrote:

If these pragmas keep popping up, we might want to consider making a dedicated macro for this that is reusable and more concise. `_Pragma` exists to have pragmas in preprocessor macros.  Not required for this PR, but food for thought in the future.

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


More information about the libc-commits mailing list